Skip to content

fix: automatically switch to fetch mode when runtime is set - #768

Merged
ClarkXia merged 3 commits into
masterfrom
fix/runtime-config
Jun 3, 2025
Merged

fix: automatically switch to fetch mode when runtime is set#768
ClarkXia merged 3 commits into
masterfrom
fix/runtime-config

Conversation

@ClarkXia

Copy link
Copy Markdown
Collaborator

This pull request introduces a new feature to automatically switch to "fetch" mode when the runtime option is set, along with related updates to improve functionality and documentation. The changes primarily focus on enhancing the handling of the runtime option in script loading and updating relevant files to reflect the new version.

@ClarkXia
ClarkXia requested review from XXXMrG and Copilot May 29, 2025 16:18

Copilot AI left a comment

Copy link
Copy Markdown

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 feature to automatically switch to "fetch" mode when the runtime option is set and updates the related configuration logic and documentation.

  • Update the configuration merge in apps.ts to consider the runtime option.
  • Refine runtime-related log messages in AppRoute.tsx.
  • Update version and changelog for the new release.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/icestark/src/apps.ts Includes runtime in deconstruction and condition update
packages/icestark/src/AppRoute.tsx Refactors runtime handling with error and warning logs
packages/icestark/package.json Bump version from 2.8.3 to 2.8.4
CHANGELOG.md Updates changelog with the new fix entry
Comments suppressed due to low confidence (1)

packages/icestark/src/apps.ts:384

  • The condition (runtime && runtime.length > 0) assumes that runtime is always an array or a string. Please ensure that runtime's type is consistent throughout the codebase or add the appropriate type-checking to improve code clarity.
const loadScriptMode = appConfig.loadScriptMode ?? (umd || sandboxEnabled || (runtime && runtime.length > 0) ? 'fetch' : 'script');

Comment thread packages/icestark/src/AppRoute.tsx
@ClarkXia
ClarkXia merged commit 3eb5fe7 into master Jun 3, 2025
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