@lynx-js/react-webpack-plugin-canary 0.13.0 → 0.13.1-canary-20261021-90bc7caf

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @lynx-js/react-webpack-plugin
2
2
 
3
+ ## 0.13.1-canary-20261021125400-90bc7cafae16ace990d013e7eaf0faf45349076a
4
+
5
+ ### Patch Changes
6
+
7
+ - Preserve imports such as `runOnBackground` when injecting background-only worklet definitions into the main thread. Keep imported bindings isolated between definitions and resolve relative imports from their original module. ([#4221](https://github.com/lynx-family/lynx-stack/pull/4221))
8
+ - Updated dependencies [[`0a56919`](https://github.com/lynx-family/lynx-stack/commit/0a569195b0979345a73ddd04800fef1cff75e169), [`90bc7ca`](https://github.com/lynx-family/lynx-stack/commit/90bc7cafae16ace990d013e7eaf0faf45349076a)]:
9
+ - @lynx-js/react@0.128.1-canary-20261021125400-90bc7cafae16ace990d013e7eaf0faf45349076a
10
+ - @lynx-js/template-webpack-plugin@0.16.5-canary-20261021125400-90bc7cafae16ace990d013e7eaf0faf45349076a
11
+
3
12
  ## 0.13.0
4
13
 
5
14
  ### Minor Changes
package/lib/Defines.d.ts CHANGED
@@ -8,6 +8,7 @@ export interface Define {
8
8
  source: string;
9
9
  imported: string;
10
10
  local: string;
11
+ namespace?: boolean;
11
12
  }>;
12
13
  runtimeRequirements?: {
13
14
  mainThreadProgrammability: boolean;
package/lib/Defines.js CHANGED
@@ -33,8 +33,8 @@ export function collectDefines(modules, buildInfoKey, getModuleIdentifier) {
33
33
  continue;
34
34
  }
35
35
  if (seen.code !== define.code
36
- || JSON.stringify(seen.imports?.map(({ source, imported, local }) => [source, imported, local]))
37
- !== JSON.stringify(define.imports?.map(({ source, imported, local }) => [source, imported, local]))) {
36
+ || JSON.stringify(seen.imports?.map(({ source, imported, local, namespace }) => [source, imported, local, namespace === true]))
37
+ !== JSON.stringify(define.imports?.map(({ source, imported, local, namespace }) => [source, imported, local, namespace === true]))) {
38
38
  throw new Error(`Two different definitions share the id ${define.id}.`);
39
39
  }
40
40
  // Equal code and dependencies identify one executable definition. Keep
@@ -67,15 +67,18 @@ export function renderDefinesModule(definesForSnapshot, definesForWorklet) {
67
67
  const imports = new Map();
68
68
  let nextImport = 0;
69
69
  const boundDefines = defines.map(define => {
70
- const bindings = (define.imports ?? []).map(({ source, imported, local }) => {
71
- const key = JSON.stringify([source, imported]);
70
+ const bindings = (define.imports ?? []).map(({ source, imported, local, namespace }) => {
71
+ const key = JSON.stringify([source, imported, namespace === true]);
72
72
  let alias = imports.get(key);
73
73
  if (alias === undefined) {
74
74
  do {
75
75
  alias = `__lynxDefineImport${nextImport++}`;
76
76
  } while (locals.has(alias));
77
77
  imports.set(key, alias);
78
- prelude.push(`import { ${imported} as ${alias} } from ${JSON.stringify(source)};`);
78
+ const binding = namespace
79
+ ? `* as ${alias}`
80
+ : `{ ${JSON.stringify(imported)} as ${alias} }`;
81
+ prelude.push(`import ${binding} from ${JSON.stringify(source)};`);
79
82
  }
80
83
  return `const ${local} = ${alias};`;
81
84
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-webpack-plugin-canary",
3
- "version": "0.13.0",
3
+ "version": "0.13.1-canary-20261021-90bc7caf",
4
4
  "description": "A webpack plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "webpack",
@@ -40,8 +40,8 @@
40
40
  "devDependencies": {
41
41
  "@lynx-js/chunk-loading-webpack-plugin": "npm:@lynx-js/chunk-loading-webpack-plugin-canary@0.4.2",
42
42
  "@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.11.1",
43
- "@lynx-js/react": "npm:@lynx-js/react-canary@0.128.0",
44
- "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.16.4",
43
+ "@lynx-js/react": "npm:@lynx-js/react-canary@0.128.1-canary-20261021-90bc7caf",
44
+ "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.16.5-canary-20261021-90bc7caf",
45
45
  "@lynx-js/test-tools": "0.0.0",
46
46
  "@microsoft/api-extractor": "7.59.4",
47
47
  "@rspack/core": "2.2.7",