-
Notifications
You must be signed in to change notification settings - Fork 927
Firestore: fix source maps that incorrectly referenced back into the bundle itself #7382
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
Conversation
🦋 Changeset detectedLatest commit: 90b3e0c The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Report 1Affected ProductsNo changes between base commit (85ccb2e) and merge commit (d04a17a).Test Logs |
Size Analysis Report 1Affected ProductsNo changes between base commit (85ccb2e) and merge commit (d04a17a).Test Logs |
@hsubox76 Posted this question to me in a different forum, and I'm moving the discussion here to keep it all together.
Good question. The sourcemaps() is there for the esm5 bundles for the non-lite SDK... it's just tucked away. The "plugins" list for the esm5 bundle contains
That
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation!
This was included in the v10.0.0 release: https://firebase.google.com/support/release-notes/js#version_1000_-_july_6_2023 |
Some of the bundles produced by Firestore's rollup pipeline generated source maps that incorrectly linked into yet another minified, mangled JavaScript file, instead of back into the original source code. This rendered the source maps useless because there was no way to get back to the original source code.
The root problem was that the rollup pipeline is done in a two step process. Step 1 produces a minified, mangled bundle and step 2 takes that minified, mangled bundle and produces other minified, mangled bundles. Surprisingly, some of the source maps did indeed map back to the original source code (i.e.
index.esm5.js.map
andindex.node.cjs.js
) but others referenced the intermediate minified, mangled bundle (i.e.index.esm2017.js
,index.cjs.js
,index.node.mjs
, andindex.browser.esm2017.js
).The "good" source maps, it was discovered, worked correctly by using the rollup-plugin-sourcemaps plugin, which "passes through" the source maps of intermediate files. So the fix was easy: just use the rollup-plugin-sourcemaps plugin in the other bundles as well. Sure enough, that is the fix in this PR and the source maps are good again.