Skip to content

De-mangle Node and CJS build #2658

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 1 commit into from
Feb 21, 2020
Merged

De-mangle Node and CJS build #2658

merged 1 commit into from
Feb 21, 2020

Conversation

schmidt-sebastian
Copy link
Contributor

@schmidt-sebastian schmidt-sebastian commented Feb 21, 2020

Removes the mangling from the Node Firestore build, which is probably not as sensitive to size. The actual fix for Node is to just add externs for GRPC and grpcloader, but at this point I am kind of wary of doing this as we have no integration tests for the mangled Node build.

I also disabled Terser's whitespace and comment removal, since this was previously not applied to NPM builds.

Fixes #2655

* Browser Builds
* Browser CJS Build
*
* The Browser CJS build is not mangled as Terser's property name mangling
Copy link
Member

Choose a reason for hiding this comment

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

Is CJS format the root of the issue? I thought only the Node build is affected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The CJS build that we published contains a bunch of variables prefixed with _PRIVATE, which are not renamed by Terser. As such, the file is bigger than before.
firebase-firestore.js uses the ESM build, before converting to CJS, which means it is not affected.

@schmidt-sebastian schmidt-sebastian merged commit fe06e91 into master Feb 21, 2020
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/node branch February 28, 2020 23:03
@firebase firebase locked and limited conversation to collaborators Mar 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when upgrading from 7.8.2 to 7.9.0
3 participants