Skip to content

Conversation

@ClarkXia
Copy link
Collaborator

This pull request introduces a new "freeze runtime" feature to the icestark package, which allows runtime libraries (like React) to be locked to a specific version and prevents them from being accidentally overwritten. The change is integrated into the configuration, asset handling utilities, and is thoroughly tested.

@wisdomofgod
Copy link
Collaborator

wisdomofgod commented Sep 17, 2025 via email

@ClarkXia ClarkXia requested review from XXXMrG and Copilot September 17, 2025 08:04
Copy link

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 introduces a new freezeRuntime configuration option to the icestark package that prevents runtime libraries from being accidentally overwritten after their initial assignment. When enabled, versioned runtime libraries (e.g., [email protected]) are locked using JavaScript property descriptors to prevent modifications.

  • Adds freezeRuntime boolean option to global configuration with default value of false
  • Implements runtime library freezing mechanism using Object.defineProperty with getter/setter logic
  • Integrates the freeze functionality into the asset handling pipeline for runtime libraries

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/icestark/src/util/globalConfiguration.ts Adds freezeRuntime configuration option with documentation
packages/icestark/src/AppRouter.tsx Passes freezeRuntime prop through to the start configuration
packages/icestark/src/util/handleAssets.ts Implements generateRuntimeLockCode function and integrates freeze logic
packages/icestark/tests/handleAssets.spec.tsx Adds comprehensive test coverage for the freezeRuntime functionality
CHANGELOG.md Documents the new feature in version 2.8.5

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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