fix: automatically switch to fetch mode when runtime is set - #768
Merged
Conversation
There was a problem hiding this comment.
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');
XXXMrG
approved these changes
Jun 3, 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 a new feature to automatically switch to "fetch" mode when the
runtimeoption is set, along with related updates to improve functionality and documentation. The changes primarily focus on enhancing the handling of theruntimeoption in script loading and updating relevant files to reflect the new version.