Conversation
🦋 Changeset detectedLatest commit: 939af36 The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 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 Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
cc7a691 to
2c6344c
Compare
DellaBitta
left a comment
There was a problem hiding this comment.
Some nits and questions, but approved overall.
packages/util/postinstall.js
Outdated
| .then(getFullConfig) | ||
| .catch(handleUnexpectedError) | ||
| .then(async config => { | ||
| const emulatorHosts = { |
There was a problem hiding this comment.
Clarification: does this execute if partialConfig is undefined (and subsequently fullConfig)?
There was a problem hiding this comment.
It does, the idea is to wipe out any hardcoded config from prior runs. The Firebase CLI will trip this script during either a Hosting deploy or emulator start.
Adds a
postinstallstep to@firebase/utilwhich hardcodes autoinit defaults into@firebase/util/dist/postinstall.(m)jsfor both CJS and ESM variants go/firestack-autoinit.Hardcoding is important since environment variable substitution doesn't dive into a developer's
node_modulesfolder. This gives us a framework agnostic way to inject configuration and is a more robust solution than the experimental autoinit methods provided by Web Frameworks go/firebase-api-client-autoinit. Once this lands, we'll backport to Hosting and Functions and aim to deprecate the other autoinit methods.I know
postinstall.jsis verbose but wanted to ensure it is compatible with the Node >= 18, has robust messaging, and fails open—e.g, overridespostinstall.(m)jssuch that it disables autoinit on failure.