Feat: support externals field in assets-manifest#7116
Merged
ClarkXia merged 1 commit intorelease/nextfrom Jul 8, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for an externals array in the assets manifest so that external scripts can be injected at runtime.
- Introduce an optional
externalsfield in the manifest type - Emit and populate the
externalsarray in the Webpack plugin - Render external scripts in the Document component
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/runtime/src/types.ts | Add externals?: string[] to AssetsManifest |
| packages/runtime/src/Document.tsx | Map over assetsManifest.externals to inject scripts |
| packages/plugin-externals/src/webpack-plugin.ts | Initialize and unshift externals into the JSON output |
| .changeset/fluffy-items-argue.md | Record the new feature in the changeset |
Comments suppressed due to low confidence (2)
packages/runtime/src/types.ts:208
- Consider adding a JSDoc comment explaining the purpose of the
externalsfield (e.g., expected value format and how it's used).
externals?: string[];
packages/plugin-externals/src/webpack-plugin.ts:30
- Add unit tests for
InjectExternalScriptsWebpackPluginto verify that theexternalsfield is created and populated correctly in the emitted manifest.
json.externals ||= [];
XXXMrG
approved these changes
Jul 3, 2025
XGHeaven
approved these changes
Jul 3, 2025
ClarkXia
added a commit
that referenced
this pull request
Jul 9, 2025
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.
This pull request introduces changes to support an
externalsfield in the assets manifest, enabling external scripts to be dynamically injected into the application. The updates span multiple files, including the@ice/plugin-externalsand@ice/runtimepackages, and involve both functionality enhancements and type definitions.