Skip to content

Rename Blob to Bytes #3677

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 4 commits into from
Aug 27, 2020
Merged

Rename Blob to Bytes #3677

merged 4 commits into from
Aug 27, 2020

Conversation

schmidt-sebastian
Copy link
Contributor

@schmidt-sebastian schmidt-sebastian commented Aug 25, 2020

As part of go/firestore-next-amendment-amendment, we decided to rename Blob to Bytes to avoid name clashes with the JavaScript Blob type.

Couple notes:

  • I created a new type instead of renaming the export since the error messages would have been incorrect.
  • I removed the now incorrect error messages in the new type.
  • I believe all of our platforms now support byte conversion (since we have the Polyfill for ReactNative, which was required to make stream resumption work). Hence, I did not port the validation.
  • The old Blob type now extends Bytes to make it easier for the serializer to use common logic.

@changeset-bot
Copy link

changeset-bot bot commented Aug 25, 2020

💥 No Changeset

Latest commit: de845b6

Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂

If these changes should be published to npm, 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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Aug 25, 2020

Binary Size Report

Affected SDKs

  • @firebase/firestore

    Type Base (96076f0) Head (9163293) Diff
    browser 249 kB 250 kB +682 B (+0.3%)
    esm2017 196 kB 196 kB +435 B (+0.2%)
    main 476 kB 476 kB +850 B (+0.2%)
    module 247 kB 247 kB +647 B (+0.3%)
    react-native 196 kB 196 kB +442 B (+0.2%)
  • @firebase/firestore/exp

    Type Base (96076f0) Head (9163293) Diff
    browser 189 kB 189 kB -484 B (-0.3%)
    main 468 kB 467 kB -374 B (-0.1%)
    module 189 kB 189 kB -484 B (-0.3%)
    react-native 189 kB 189 kB -340 B (-0.2%)
  • @firebase/firestore/lite

    Type Base (96076f0) Head (9163293) Diff
    browser 64.7 kB 64.2 kB -482 B (-0.7%)
    main 141 kB 141 kB -460 B (-0.3%)
    module 64.7 kB 64.2 kB -482 B (-0.7%)
    react-native 64.8 kB 64.5 kB -352 B (-0.5%)
  • @firebase/firestore/memory

    Type Base (96076f0) Head (9163293) Diff
    browser 187 kB 188 kB +669 B (+0.4%)
    esm2017 147 kB 147 kB +419 B (+0.3%)
    main 349 kB 350 kB +850 B (+0.2%)
    module 185 kB 186 kB +622 B (+0.3%)
    react-native 147 kB 147 kB +429 B (+0.3%)
  • firebase

    Type Base (96076f0) Head (9163293) Diff
    firebase-firestore.js 288 kB 288 kB +633 B (+0.2%)
    firebase-firestore.memory.js 227 kB 228 kB +632 B (+0.3%)
    firebase.js 823 kB 823 kB +634 B (+0.1%)

Test Logs

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Aug 25, 2020

Size Analysis Report

Affected Products

No changes between base commit (96076f0) and head commit (9163293).

Test Logs

Copy link

@thebrianchen thebrianchen left a comment

Choose a reason for hiding this comment

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

lgtm! I really tried to find nits, but I couldn't

this._byteString = byteString;
}

export class Blob extends Bytes {

Choose a reason for hiding this comment

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

optional: It might be helpful to add some context in comments about why the main SDK's Blob is extending the Bytes class in the Lite SDK. It's clear to me what's happening when I look at the PR description, but without it, I would be confused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done (but missed this before merging - coming in the next PR).

@schmidt-sebastian schmidt-sebastian merged commit e22a295 into master Aug 27, 2020
@firebase firebase locked and limited conversation to collaborators Sep 27, 2020
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/renames-blobbytes branch November 9, 2020 22:36
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.

3 participants