Skip to content

Compat and @exp class for DataSnapshot #4686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 30, 2021

Conversation

schmidt-sebastian
Copy link
Contributor

@schmidt-sebastian schmidt-sebastian commented Mar 29, 2021

This PR creates the Compat class for DataSnapshot, and also adds the @exp class at the same time (mostly by moving code).

There are a bunch of seemingly unrelated changes, but most of them are meant to remove internal references to the old legacy DataSnapshot from /core.

The next step would be to do this same change for Reference, since I only converted the code paths that I needed for the conversion.

One extra thing: The current SDK accepts numbers and string in some places for child keys, but this is not documented. I dropped accepting numbers for now.

@changeset-bot
Copy link

changeset-bot bot commented Mar 29, 2021

⚠️ No Changeset found

Latest commit: 48d38ac

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@schmidt-sebastian schmidt-sebastian changed the base branch from master to database-exp-master March 29, 2021 18:04
import { Reference } from './Reference';
import { child, Reference } from './Reference';
import { Node } from '../core/snap/Node';
import { Index } from '../core/snap/indexes';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is breaking the build because I think it wants indexes/Index and I guess this shortcut works if a file is named index but I think it might be case sensitive. Didn't go through the rest of the PR yet, just wanted to put in this comment first because I think it's what's breaking the build.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed this and the tests are passing. I can't come up with a better name for this file, otherwise I would have changed it long ago.

Copy link
Contributor

@hsubox76 hsubox76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG other than the build issue (see previous comment).

@google-oss-bot
Copy link
Contributor

Binary Size Report

Affected SDKs

  • @firebase/database

    Type Base (975da07) Head (1ee0974) Diff
    browser 275 kB 278 kB +2.90 kB (+1.1%)
    esm2017 248 kB 250 kB +1.60 kB (+0.6%)
    main 277 kB 280 kB +2.87 kB (+1.0%)
    module 275 kB 278 kB +2.90 kB (+1.1%)
  • @firebase/database-exp

    Type Base (975da07) Head (1ee0974) Diff
    browser 3.42 kB 15.1 kB +11.7 kB (+342.5%)
    esm2017 2.74 kB 12.7 kB +9.98 kB (+364.7%)
    main 5.66 kB 17.4 kB +11.7 kB (+207.4%)
    module 3.42 kB 15.1 kB +11.7 kB (+342.5%)
  • firebase

    Type Base (975da07) Head (1ee0974) Diff
    firebase-database.js 178 kB 180 kB +1.94 kB (+1.1%)
    firebase.js 839 kB 841 kB +1.95 kB (+0.2%)

Test Logs

@google-oss-bot
Copy link
Contributor

Size Analysis Report

Affected Products

No changes between base commit (975da07) and head commit (1ee0974).

@schmidt-sebastian schmidt-sebastian merged commit fe0469f into database-exp-master Mar 30, 2021
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/snapshot branch March 30, 2021 20:55
Feiyang1 pushed a commit that referenced this pull request Apr 8, 2021
* Add database@exp API (#4614)

* Compat and @exp class for DataSnapshot (#4686)

* Add events to database@exp (#4694)

* Compat and @exp class for Database (#4705)

* Implement Query Compat and query@exp (#4709)

* Compat class for Reference (#4719)

* OnDisconnect Compat (#4727)

* ServerValues compat (#4728)

* EnableLogging Compat (#4730)

* Remove argument numbers from validation (#4729)

* Update changeset

* Add database@exp API docs (#4738)

* Add Support for API report (#4741)

* Update lets-go-travel.md

* Update enableLogging
Feiyang1 added a commit that referenced this pull request Apr 8, 2021
* Add database@exp API (#4614)

* Compat and @exp class for DataSnapshot (#4686)

* Add events to database@exp (#4694)

* Compat and @exp class for Database (#4705)

* Implement Query Compat and query@exp (#4709)

* Compat class for Reference (#4719)

* OnDisconnect Compat (#4727)

* ServerValues compat (#4728)

* EnableLogging Compat (#4730)

* Remove argument numbers from validation (#4729)

* Update changeset

* Add database@exp API docs (#4738)

* Add Support for API report (#4741)

* pacakge database compat

* export child as a public API

* address comments

* create database-compat dir

* create overloads for database-compat

* build database

* add database-compat to firebase-exp

* fix lint errors

* include compat in build

* fix typing errors

* fix script name

* make database types compatible

* use modular instance

Co-authored-by: Sebastian Schmidt <[email protected]>
@firebase firebase locked and limited conversation to collaborators Apr 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants