Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/swift-pots-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@lynx-js/react": minor
"@lynx-js/react-rsbuild-plugin": minor
---

**BREAKING CHANGE**:

Change preact package from `@hongzhiyuan/preact` to `@lynx-js/internal-preact`.

Upgrade preact from [f7693b72](https://github.com/preactjs/preact/commit/f7693b72ecb4a40c66e6e47f54e2d4edc374c9f0) to [55254ef7](https://github.com/preactjs/preact/commit/55254ef7021e563cc1a86fb816058964a1b6a29a), see diffs at [f7693b72...55254ef7](https://github.com/preactjs/preact/compare/f7693b72ecb4a40c66e6e47f54e2d4edc374c9f0...preactjs:preact:55254ef7021e563cc1a86fb816058964a1b6a29a?expand=1).
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"api-extractor": "api-extractor run --verbose"
},
"dependencies": {
"preact": "npm:@hongzhiyuan/preact@10.28.0-fc4af453"
"preact": "npm:@lynx-js/internal-preact@10.28.4-ee7bb26"
Comment thread
upupming marked this conversation as resolved.
},
"devDependencies": {
"@lynx-js/types": "3.7.0",
Expand Down
15 changes: 1 addition & 14 deletions packages/react/runtime/src/backgroundSnapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,6 @@ export class BackgroundSnapshotInstance {
private __nextSibling: BackgroundSnapshotInstance | null = null;
private __removed_from_tree?: boolean;

private get isDetached(): boolean {
let node: BackgroundSnapshotInstance | null = this;
while (node) {
if (node.__removed_from_tree) {
return true;
}
node = node.__parent;
}
return false;
}

get parentNode(): BackgroundSnapshotInstance | null {
return this.__parent;
}
Expand All @@ -97,9 +86,7 @@ export class BackgroundSnapshotInstance {

// This will be called in `lazy`/`Suspense`.
appendChild(child: BackgroundSnapshotInstance): void {
if (!this.isDetached) {
return this.insertBefore(child);
}
return this.insertBefore(child);
}
Comment thread
upupming marked this conversation as resolved.

insertBefore(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,19 +385,19 @@ describe('pluginReactLynx', () => {
"@lynx-js/react/runtime-components$": "<WORKSPACE>/packages/react/components/lib/index.js",
"@lynx-js/react/worklet-runtime/bindings$": "<WORKSPACE>/packages/react/worklet-runtime/lib/bindings/index.js",
"@swc/helpers": "<WORKSPACE>/node_modules/<PNPM_INNER>/@swc/helpers",
"preact$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@hongzhiyuan/preact/dist/preact.mjs",
"preact/compat$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@hongzhiyuan/preact/compat/dist/compat.mjs",
"preact/compat/client$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@hongzhiyuan/preact/compat/client.mjs",
"preact/compat/jsx-dev-runtime$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@hongzhiyuan/preact/compat/jsx-dev-runtime.mjs",
"preact/compat/jsx-runtime$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@hongzhiyuan/preact/compat/jsx-runtime.mjs",
"preact/compat/scheduler$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@hongzhiyuan/preact/compat/scheduler.mjs",
"preact/compat/server$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@hongzhiyuan/preact/compat/server.mjs",
"preact/debug$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@hongzhiyuan/preact/debug/dist/debug.mjs",
"preact/devtools$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@hongzhiyuan/preact/devtools/dist/devtools.mjs",
"preact/hooks$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@hongzhiyuan/preact/hooks/dist/hooks.mjs",
"preact/jsx-dev-runtime$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@hongzhiyuan/preact/jsx-runtime/dist/jsxRuntime.mjs",
"preact/jsx-runtime$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@hongzhiyuan/preact/jsx-runtime/dist/jsxRuntime.mjs",
"preact/test-utils$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@hongzhiyuan/preact/test-utils/dist/testUtils.mjs",
"preact$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@lynx-js/internal-preact/dist/preact.mjs",
"preact/compat$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@lynx-js/internal-preact/compat/dist/compat.mjs",
"preact/compat/client$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@lynx-js/internal-preact/compat/client.mjs",
"preact/compat/jsx-dev-runtime$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@lynx-js/internal-preact/compat/jsx-dev-runtime.mjs",
"preact/compat/jsx-runtime$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@lynx-js/internal-preact/compat/jsx-runtime.mjs",
"preact/compat/scheduler$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@lynx-js/internal-preact/compat/scheduler.mjs",
"preact/compat/server$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@lynx-js/internal-preact/compat/server.mjs",
"preact/debug$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@lynx-js/internal-preact/debug/dist/debug.mjs",
"preact/devtools$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@lynx-js/internal-preact/devtools/dist/devtools.mjs",
"preact/hooks$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@lynx-js/internal-preact/hooks/dist/hooks.mjs",
"preact/jsx-dev-runtime$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@lynx-js/internal-preact/jsx-runtime/dist/jsxRuntime.mjs",
"preact/jsx-runtime$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@lynx-js/internal-preact/jsx-runtime/dist/jsxRuntime.mjs",
"preact/test-utils$": "<WORKSPACE>/node_modules/<PNPM_INNER>/@lynx-js/internal-preact/test-utils/dist/testUtils.mjs",
"react$": "<WORKSPACE>/packages/react/runtime/lib/index.js",
"react-compiler-runtime": "<WORKSPACE>/node_modules/<PNPM_INNER>/react-compiler-runtime",
"use-sync-external-store$": "<WORKSPACE>/packages/use-sync-external-store/index.js",
Expand Down
56 changes: 43 additions & 13 deletions packages/rspeedy/plugin-react-alias/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,79 +75,109 @@ describe('React - alias', () => {
expect(config.resolve.alias).toHaveProperty(
'preact$',
expect.stringContaining(
'/preact/dist/preact.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/dist/preact.mjs'.replaceAll('/', path.sep),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/compat$',
expect.stringContaining(
'/preact/compat/dist/compat.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/compat/dist/compat.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/debug$',
expect.stringContaining(
'/preact/debug/dist/debug.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/debug/dist/debug.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/devtools$',
expect.stringContaining(
'/preact/devtools/dist/devtools.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/devtools/dist/devtools.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/hooks$',
expect.stringContaining(
'/preact/hooks/dist/hooks.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/hooks/dist/hooks.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/test-utils$',
expect.stringContaining(
'/preact/test-utils/dist/testUtils.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/test-utils/dist/testUtils.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/jsx-runtime$',
expect.stringContaining(
'/preact/jsx-runtime/dist/jsxRuntime.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/jsx-runtime/dist/jsxRuntime.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/jsx-dev-runtime$',
expect.stringContaining(
'/preact/jsx-runtime/dist/jsxRuntime.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/jsx-runtime/dist/jsxRuntime.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/compat/client$',
expect.stringContaining(
'/preact/compat/client.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/compat/client.mjs'.replaceAll('/', path.sep),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/compat/server$',
expect.stringContaining(
'/preact/compat/server.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/compat/server.mjs'.replaceAll('/', path.sep),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/compat/jsx-runtime$',
expect.stringContaining(
'/preact/compat/jsx-runtime.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/compat/jsx-runtime.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/compat/jsx-dev-runtime$',
expect.stringContaining(
'/preact/compat/jsx-dev-runtime.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/compat/jsx-dev-runtime.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/compat/scheduler$',
expect.stringContaining(
'/preact/compat/scheduler.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/compat/scheduler.mjs'.replaceAll(
'/',
path.sep,
),
),
)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/rspeedy/plugin-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"typia-rspack-plugin": "2.2.2"
},
"peerDependencies": {
"@lynx-js/react": "^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0 || ^0.108.0 || ^0.109.0 || ^0.110.0 || ^0.111.0 || ^0.112.0 || ^0.113.0 || ^0.114.0 || ^0.115.0 || ^0.116.0"
"@lynx-js/react": "^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0 || ^0.108.0 || ^0.109.0 || ^0.110.0 || ^0.111.0 || ^0.112.0 || ^0.113.0 || ^0.114.0 || ^0.115.0 || ^0.116.0 || ^0.117.0"
},
"peerDependenciesMeta": {
"@lynx-js/react": {
Expand Down
2 changes: 1 addition & 1 deletion packages/rspeedy/plugin-react/src/splitChunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const applySplitChunksRule: (
extraGroups['preact'] = {
name: 'lib-preact',
test:
/node_modules[\\/](.*?[\\/])?(?:preact|preact[\\/]compat|preact[\\/]hooks|preact[\\/]jsx-runtime)[\\/]/,
/node_modules[\\/](.*?[\\/])?(?:(?:internal-)?preact|(?:internal-)?preact[\\/]compat|(?:internal-)?preact[\\/]hooks|(?:internal-)?preact[\\/]jsx-runtime)[\\/]/,
priority: 0,
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

Expand Down
58 changes: 44 additions & 14 deletions packages/rspeedy/plugin-react/test/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,79 +81,109 @@ describe('Config', () => {
expect(config.resolve.alias).toHaveProperty(
'preact$',
expect.stringContaining(
'/preact/dist/preact.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/dist/preact.mjs'.replaceAll('/', path.sep),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/compat$',
expect.stringContaining(
'/preact/compat/dist/compat.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/compat/dist/compat.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/debug$',
expect.stringContaining(
'/preact/debug/dist/debug.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/debug/dist/debug.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/devtools$',
expect.stringContaining(
'/preact/devtools/dist/devtools.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/devtools/dist/devtools.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/hooks$',
expect.stringContaining(
'/preact/hooks/dist/hooks.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/hooks/dist/hooks.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/test-utils$',
expect.stringContaining(
'/preact/test-utils/dist/testUtils.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/test-utils/dist/testUtils.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/jsx-runtime$',
expect.stringContaining(
'/preact/jsx-runtime/dist/jsxRuntime.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/jsx-runtime/dist/jsxRuntime.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/jsx-dev-runtime$',
expect.stringContaining(
'/preact/jsx-runtime/dist/jsxRuntime.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/jsx-runtime/dist/jsxRuntime.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/compat/client$',
expect.stringContaining(
'/preact/compat/client.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/compat/client.mjs'.replaceAll('/', path.sep),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/compat/server$',
expect.stringContaining(
'/preact/compat/server.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/compat/server.mjs'.replaceAll('/', path.sep),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/compat/jsx-runtime$',
expect.stringContaining(
'/preact/compat/jsx-runtime.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/compat/jsx-runtime.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/compat/jsx-dev-runtime$',
expect.stringContaining(
'/preact/compat/jsx-dev-runtime.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/compat/jsx-dev-runtime.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
'preact/compat/scheduler$',
expect.stringContaining(
'/preact/compat/scheduler.mjs'.replaceAll('/', path.sep),
'@lynx-js/internal-preact/compat/scheduler.mjs'.replaceAll(
'/',
path.sep,
),
),
)
expect(config.resolve.alias).toHaveProperty(
Expand Down Expand Up @@ -1691,7 +1721,7 @@ describe('Config', () => {
{
"name": "lib-preact",
"priority": 0,
"test": /node_modules\\[\\\\\\\\/\\]\\(\\.\\*\\?\\[\\\\\\\\/\\]\\)\\?\\(\\?:preact\\|preact\\[\\\\\\\\/\\]compat\\|preact\\[\\\\\\\\/\\]hooks\\|preact\\[\\\\\\\\/\\]jsx-runtime\\)\\[\\\\\\\\/\\]/,
"test": /node_modules\\[\\\\\\\\/\\]\\(\\.\\*\\?\\[\\\\\\\\/\\]\\)\\?\\(\\?:\\(\\?:internal-\\)\\?preact\\|\\(\\?:internal-\\)\\?preact\\[\\\\\\\\/\\]compat\\|\\(\\?:internal-\\)\\?preact\\[\\\\\\\\/\\]hooks\\|\\(\\?:internal-\\)\\?preact\\[\\\\\\\\/\\]jsx-runtime\\)\\[\\\\\\\\/\\]/,
}
`)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default {
preact: {
name: 'lib-preact',
test:
/node_modules[\\/](.*?[\\/])?(?:preact|preact[\\/]compat|preact[\\/]hooks|preact[\\/]jsx-runtime)[\\/]/,
/node_modules[\\/](.*?[\\/])?(?:(?:internal-)?preact|(?:internal-)?preact[\\/]compat|(?:internal-)?preact[\\/]hooks|(?:internal-)?preact[\\/]jsx-runtime)[\\/]/,
priority: 0,
},
},
Expand Down
Loading
Loading