Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Removes an obsolete text-encoding polyfill from the FxA auth client and legacy content server.
Changes:
- Removes conditional polyfill loading from
AuthClient.create. - Removes the webpack alias and package dependencies.
- Updates the lockfile accordingly.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/fxa-auth-client/lib/client.ts |
Removes dynamic polyfill loading. |
packages/fxa-auth-client/package.json |
Drops polyfill packages. |
packages/fxa-content-server/package.json |
Drops the runtime dependency. |
packages/fxa-content-server/webpack.config.js |
Removes the obsolete alias. |
yarn.lock |
Removes dependency resolutions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Because
TextEncoderandTextDecoderare globals in every Node and browser target FxA supports, so thefast-text-encodingpolyfill never loads.This pull request
typeof TextEncoder === 'undefined'guard and its dynamic import fromAuthClient.createinclient.ts.fast-text-encodingresolve alias fromwebpack.config.js.fast-text-encodingand@types/fast-text-encodingfrom thefxa-auth-clientandfxa-content-servermanifests, and updatesyarn.lockto match.Issue that this pull request solves
Closes: https://mozilla-hub.atlassian.net/browse/FXA-13921
Checklist
Put an
xin the boxes that applyHow to review (Optional)
AuthClient.createinpackages/fxa-auth-client/lib/client.ts.client.ts, then the webpack alias, then the two manifests and the lockfile.TextEncoderexists in all supported targets is the reviewer's to confirm.Screenshots (Optional)
Other information (Optional)
packages/fxa-auth-clientpublishes to npm, so third parties consume it. Today, on an environment with no globalTextEncoder,AuthClient.create()recovers by loading the polyfill. After this change it does not, and such a consumer fails later insidecheckWebCryptoor during key derivation. Nothing replaces the guard, since the ticket asks for removal rather than a substitute. No exported signature moves, so this is not an API change.Verified locally:
nx lint fxa-auth-clientandnx lint fxa-content-serverpass,tsc -p packages/fxa-auth-client/tsconfig.json --noEmitis clean, and thefxa-auth-clientunit suite passes (47 tests). No tests were added or changed. Functional tests were not run.