Skip to content

Comments

Feat: support externals field in assets-manifest#7116

Merged
ClarkXia merged 1 commit intorelease/nextfrom
fix/external
Jul 8, 2025
Merged

Feat: support externals field in assets-manifest#7116
ClarkXia merged 1 commit intorelease/nextfrom
fix/external

Conversation

@ClarkXia
Copy link
Collaborator

@ClarkXia ClarkXia commented Jul 3, 2025

This pull request introduces changes to support an externals field in the assets manifest, enabling external scripts to be dynamically injected into the application. The updates span multiple files, including the @ice/plugin-externals and @ice/runtime packages, and involve both functionality enhancements and type definitions.

@ClarkXia ClarkXia changed the base branch from master to release/next July 3, 2025 08:07
@ClarkXia ClarkXia requested review from XGHeaven, XXXMrG and Copilot July 3, 2025 08:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 externals field in the manifest type
  • Emit and populate the externals array 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 externals field (e.g., expected value format and how it's used).
  externals?: string[];

packages/plugin-externals/src/webpack-plugin.ts:30

  • Add unit tests for InjectExternalScriptsWebpackPlugin to verify that the externals field is created and populated correctly in the emitted manifest.
            json.externals ||= [];

@ClarkXia ClarkXia merged commit 4569200 into release/next Jul 8, 2025
10 checks passed
@ClarkXia ClarkXia deleted the fix/external branch July 8, 2025 08:40
ClarkXia added a commit that referenced this pull request Jul 9, 2025
* feat: support externals field in assets-manifest (#7116)

* chore: version

* chore: update version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants