Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ClarkXia
Copy link
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
Copy link

@Copilot 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 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');

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.

1 participant