-
Notifications
You must be signed in to change notification settings - Fork 895
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
Put firebase/* entry point ESM files in their own subdirs with "type: module" package.json #6826
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🦋 Changeset detectedLatest commit: b4bec51 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 Products
Test Logs |
Size Analysis Report 1This report is too large (759,964 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.Test Logs |
dwyfrequency
approved these changes
Nov 30, 2022
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.
LGTM
Merged
levino
pushed a commit
to levino/firebase-js-sdk
that referenced
this pull request
Dec 10, 2022
… module" package.json (firebase#6826)
This was referenced Dec 15, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #6747
More build tooling these days is requiring all ESM bundles conform to Node ESM rules, even if the bundles are mainly used in the browser (for example, many test frameworks run browser tests in Node and require all bundles to meet Node ESM rules when the tests are run). This may also affect SSR/SSG.
The rules are essentially that the extension must be
.mjs
OR the nearest package.json file must have a line that saystype: "module"
.We avoid putting an mjs extension on browser bundles because some older build tools and environments don't know how to handle that extension. Instead, in the
@firebase/*
packages, we have put ESM files in their own subdirectory indist/
(dist/esm/
) and used a rollup plugin put a one-line package.json file in there with them that says "type: module". This build step had not been applied to thefirebase/*
packages (the entry point packages that just redirect to the equivalent@firebase/*
package).It's possible that some tooling is happy enough with the end package (
@firebase/*
) having this setup (the way it is now), while other tooling requires the Node ESM indicators to be there at every step of resolution (explaining issues still being reported by some users).I've added this step to the entry point
firebase/*
packages in this PR hoping this will fix it for those users.