Compare commits

..

10 Commits

Author SHA1 Message Date
ClarkXia e50cf46419
Update package.json
CI / build (16.x, ubuntu-latest) (push) Has been cancelled Details
CI / build (16.x, windows-latest) (push) Has been cancelled Details
CI / build (18.x, ubuntu-latest) (push) Has been cancelled Details
CI / build (18.x, windows-latest) (push) Has been cancelled Details
2025-07-08 19:09:56 +08:00
ClarkXia 763a1e6602
Update CHANGELOG.md 2025-07-08 19:09:41 +08:00
ClarkXia 3d762f58b9
Update package.json 2025-07-08 19:09:18 +08:00
ClarkXia a257d585af
Update CHANGELOG.md 2025-07-08 19:09:01 +08:00
ClarkXia 096fa4ee7c
Update package.json 2025-07-08 19:07:32 +08:00
ClarkXia 29f0a171ca
Update package.json 2025-07-08 19:07:02 +08:00
ClarkXia d9a2e91f5c
Update package.json 2025-07-08 19:06:22 +08:00
ClarkXia f177d1b22e
Update package.json 2025-07-08 19:05:42 +08:00
ClarkXia 49c7c19974
Update CHANGELOG.md 2025-07-08 19:05:29 +08:00
ClarkXia e82fa0f7b9 chore: update versions 2025-07-08 11:04:30 +00:00
19 changed files with 31 additions and 122 deletions

View File

@ -1,13 +1,5 @@
# Changelog
## 3.6.4
### Patch Changes
- 0dd4aab0: refactor: add env for themis, delete PHA/Kraken, simplize WindVane
- Updated dependencies [d55e34bc]
- @ice/runtime@1.5.6
## 3.6.3
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@ice/app",
"version": "3.6.4",
"version": "3.6.3",
"description": "provide scripts and configuration used by web framework ice",
"type": "module",
"main": "./esm/index.js",

View File

@ -9,14 +9,16 @@ export const isByteDanceMicroApp = isClient && import.meta.target === 'bytedance
export const isBaiduSmartProgram = isClient && import.meta.target === 'baidu-smartprogram';
export const isKuaiShouMiniProgram = isClient && import.meta.target === 'kuaishou-miniprogram';
export const isWeChatMiniProgram = isClient && import.meta.target === 'wechat-miniprogram';
export const isKraken = isClient && import.meta.target === 'kraken';
export const isQuickApp = false; // Now ice.js will not implement quick app target.
export const isMiniApp = isAliMiniApp; // in universal-env, isMiniApp is equals to isAliMiniApp
export const isMiniApp = isAliMiniApp;// in universal-env, isMiniApp is equals to isAliMiniApp
// Following variables are runtime executed envs.
// See also @uni/env.
export const isPHA = isWeb && typeof pha === 'object';
const ua = typeof navigator === 'object' ? navigator.userAgent || navigator.swuserAgent : '';
export const isThemis = /Themis/.test(ua);
export const isWindVane = /WindVane/i.test(ua) && isWeb && typeof WindVane !== 'undefined' && typeof WindVane.call !== 'undefined';
const wvRegExp = /.+AliApp\((\w+)\/((?:\d+\.)+\d+)\).* .*(WindVane)(?:\/((?:\d+\.)+\d+))?.*/;
export const isWindVane = wvRegExp.test(ua) && isWeb && typeof WindVane !== 'undefined' && typeof WindVane.call !== 'undefined';
// WindVane.call is a function while page importing lib-windvane
export const isFRM = isMiniApp && isWeb && typeof my !== 'undefined' && typeof my.isFRM !== 'undefined';
@ -25,13 +27,14 @@ export default {
isWeb,
isNode,
isWeex,
isThemis,
isKraken,
isMiniApp,
isByteDanceMicroApp,
isBaiduSmartProgram,
isKuaiShouMiniProgram,
isWeChatMiniProgram,
isQuickApp,
isPHA,
isWindVane,
isFRM,
};

View File

@ -1,17 +1,5 @@
# @ice/miniapp-react-dom
## 1.1.6
### Patch Changes
- @ice/miniapp-runtime@1.2.6
## 1.1.5
### Patch Changes
- @ice/miniapp-runtime@1.2.5
## 1.1.4
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@ice/miniapp-react-dom",
"version": "1.1.6",
"version": "1.1.4",
"description": "like react-dom, but for miniapps.",
"type": "module",
"types": "./esm/index.d.ts",

View File

@ -1,19 +1,5 @@
# Changelog
## 1.2.6
### Patch Changes
- Updated dependencies [d55e34bc]
- @ice/runtime@1.5.6
## 1.2.5
### Patch Changes
- Updated dependencies [1a0a2c1f]
- @ice/runtime@1.5.4
## 1.2.4
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@ice/miniapp-runtime",
"version": "1.2.6",
"version": "1.2.4",
"description": "ice runtime for miniapps.",
"type": "module",
"types": "./esm/index.d.ts",

View File

@ -4,7 +4,7 @@
### Patch Changes
- 4569200ca: fix: support externals field in assets-manifest
- 4569200c: fix: support externals field in assets-manifest
## 1.0.0

View File

@ -21,7 +21,7 @@
},
"devDependencies": {
"@ice/app": "^3.3.2",
"@ice/runtime": "^1.2.9",
"@ice/runtime": "^1.5.4",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"webpack": "^5.88.0"

View File

@ -56,8 +56,8 @@
"webpack-dev-server": "4.15.0"
},
"peerDependencies": {
"@ice/app": "^3.6.4",
"@ice/runtime": "^1.5.6"
"@ice/app": "^3.6.3",
"@ice/runtime": "^1.5.4"
},
"publishConfig": {
"access": "public"

View File

@ -1,12 +1,5 @@
# Changelog
## 1.2.7
### Patch Changes
- @ice/miniapp-runtime@1.2.6
- @ice/miniapp-react-dom@1.1.6
## 1.2.6
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@ice/plugin-miniapp",
"version": "1.2.7",
"version": "1.2.6",
"description": "ice.js plugin for miniapp.",
"license": "MIT",
"type": "module",
@ -50,8 +50,8 @@
"sax": "^1.2.4"
},
"devDependencies": {
"@ice/app": "^3.6.4",
"@ice/runtime": "^1.5.6",
"@ice/app": "^3.6.3",
"@ice/runtime": "^1.5.4",
"webpack": "^5.88.0"
},
"repository": {

View File

@ -1,9 +1,5 @@
# @ice/plugin-stream-error
## 1.0.3
- feat: empty root element when stream error
## 1.0.0
### Major Changes

View File

@ -1,6 +1,6 @@
{
"name": "@ice/plugin-stream-error",
"version": "1.0.3",
"version": "1.0.2",
"description": "",
"license": "MIT",
"type": "module",

View File

@ -2,16 +2,13 @@ import type { Plugin } from '@ice/app/types';
interface PluginOptions {
activeInDev?: boolean;
rootId?: string;
}
const PLUGIN_NAME = '@ice/plugin-stream-error';
const plugin: Plugin<PluginOptions> = (options = {
rootId: 'root',
}) => ({
const plugin: Plugin<PluginOptions> = (options = {}) => ({
name: PLUGIN_NAME,
setup: ({ generator, context }) => {
const { activeInDev, rootId } = options;
const { activeInDev } = options;
const { userConfig } = context;
if (userConfig.ssr) {
generator.addEntryCode((originalCode) => {
@ -21,11 +18,6 @@ if (import.meta.renderer === 'client') {
// _$ServerTimePoints will returned at the end of last stream,
// if the value is undefined, try to re-render app with CSR.
if (${activeInDev ? '' : 'process.env.NODE_ENV === \'production\' && '}!window._$ServerTimePoints && window.__ICE_APP_CONTEXT__.renderMode === 'SSR') {
const root = document.getElementById('${rootId}');
if (root) {
root.innerHTML = '';
}
window.__ICE_APP_CONTEXT__.renderMode = 'CSR';
render({ hydrate: false });
}
});

View File

@ -1,22 +1,10 @@
# @ice/runtime
## 1.5.6
### Patch Changes
- d55e34bc: feat: add suspense event dispatch in Suspense component
## 1.5.5
### Patch Changes
- 4569200ca: fix: support externals field in assets-manifest
## 1.5.4
### Patch Changes
- 1a0a2c1f: feat: Add custom event for suspense data updates, and remove ice-suspense custom event.
- 4569200c: fix: support externals field in assets-manifest
## 1.5.3

View File

@ -1,6 +1,6 @@
{
"name": "@ice/runtime",
"version": "1.5.6",
"version": "1.5.4",
"description": "Runtime module for ice.js",
"type": "module",
"types": "./esm/index.d.ts",

View File

@ -126,11 +126,6 @@ interface SuspenseProps {
[key: string]: any;
}
function dispatchSuspenseEvent(event: string, id: string) {
window.dispatchEvent(new CustomEvent(event, { detail: { id } }));
}
const DISPATCH_SUSPENSE_EVENT_STRING = dispatchSuspenseEvent.toString();
export function withSuspense(Component) {
return (props: SuspenseProps) => {
const { fallback, id, ...componentProps } = props;
@ -158,22 +153,15 @@ export function withSuspense(Component) {
return (
<React.Suspense fallback={fallback || null}>
<InlineScript
id={`suspense-parse-start-${id}`}
script={`(${DISPATCH_SUSPENSE_EVENT_STRING})('ice-suspense-parse-start','${id}');`}
/>
<SuspenseContext.Provider value={suspenseState}>
<Component {...componentProps} />
<InlineScript
id={`suspense-parse-data-${id}`}
script={`(${DISPATCH_SUSPENSE_EVENT_STRING})('ice-suspense-parse-data','${id}');`}
/>
<Data id={id} />
<script
dangerouslySetInnerHTML={{
__html: `window.dispatchEvent(new CustomEvent('ice-suspense', { detail: { id: ${id ? `'${id}'` : undefined} } }));`,
}}
/>
</SuspenseContext.Provider>
<InlineScript
id={`suspense-parse-end-${id}`}
script={`(${DISPATCH_SUSPENSE_EVENT_STRING})('ice-suspense-parse-end','${id}');`}
/>
</React.Suspense>
);
};
@ -186,25 +174,8 @@ function Data(props) {
<script
id={props.id && `suspense-script-${props.id}`}
dangerouslySetInnerHTML={{
__html: `!function(){window['${LOADER}'] = window['${LOADER}'] || {};window['${LOADER}']['${props.id}'] = ${JSON.stringify(data)}}();window.dispatchEvent(new CustomEvent('ice-suspense-data', { detail: { id: ${props.id ? `'${props.id}'` : undefined} } }));`,
__html: `!function(){window['${LOADER}'] = window['${LOADER}'] || {};window['${LOADER}']['${props.id}'] = ${JSON.stringify(data)}}();`,
}}
/>
);
}
interface InlineScriptProps {
id: string;
script: string;
}
function InlineScript(props: InlineScriptProps) {
return (
<script
id={props.id}
dangerouslySetInnerHTML={{
__html: props.script,
}}
suppressHydrationWarning
/>
);
}

View File

@ -1962,10 +1962,10 @@ importers:
packages/plugin-externals:
devDependencies:
'@ice/app':
specifier: ^3.3.2
specifier: ^3.6.4
version: link:../ice
'@ice/runtime':
specifier: ^1.2.9
specifier: ^1.5.4
version: link:../runtime
'@types/react':
specifier: ^18.0.0
@ -2160,7 +2160,7 @@ importers:
specifier: ^3.6.4
version: link:../ice
'@ice/runtime':
specifier: ^1.5.6
specifier: ^1.5.4
version: link:../runtime
webpack:
specifier: ^5.88.0