@lynx-js/react-webpack-plugin-canary 0.6.15 → 0.6.16-canary-20250610-0a0ef409
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 +21 -12
- package/lib/ReactWebpackPlugin.js +1 -0
- package/lib/loaders/options.js +4 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @lynx-js/react-webpack-plugin
|
|
2
2
|
|
|
3
|
+
## 0.6.16-canary-20250610075412-0a0ef4094a9c81f8849605c17a4c8f08dc128171
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Keep snapshot id unchanged on Windows. ([#1050](https://github.com/lynx-family/lynx-stack/pull/1050))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`c181888`](https://github.com/lynx-family/lynx-stack/commit/c1818881c009de3c25b0a5b447ddd027c6b4ac20)]:
|
|
10
|
+
- @lynx-js/react@0.109.3-canary-20250610075412-0a0ef4094a9c81f8849605c17a4c8f08dc128171
|
|
11
|
+
|
|
3
12
|
## 0.6.15
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -66,7 +75,7 @@
|
|
|
66
75
|
- Shake `useImperativeHandle` on the main-thread by default. ([#153](https://github.com/lynx-family/lynx-stack/pull/153))
|
|
67
76
|
|
|
68
77
|
```js
|
|
69
|
-
import { forwardRef, useImperativeHandle } from
|
|
78
|
+
import { forwardRef, useImperativeHandle } from "@lynx-js/react";
|
|
70
79
|
|
|
71
80
|
export default forwardRef(function App(_, ref) {
|
|
72
81
|
useImperativeHandle(ref, () => {
|
|
@@ -74,7 +83,7 @@
|
|
|
74
83
|
return {
|
|
75
84
|
name() {
|
|
76
85
|
// This should be considered as background only
|
|
77
|
-
console.info(
|
|
86
|
+
console.info("This should not exist in main-thread");
|
|
78
87
|
},
|
|
79
88
|
};
|
|
80
89
|
});
|
|
@@ -134,14 +143,14 @@
|
|
|
134
143
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
135
144
|
|
|
136
145
|
```js
|
|
137
|
-
import { pluginReactLynx } from
|
|
138
|
-
import { defineConfig } from
|
|
146
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
147
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
139
148
|
|
|
140
149
|
export default defineConfig({
|
|
141
150
|
plugins: [
|
|
142
151
|
pluginReactLynx({
|
|
143
152
|
defineDCE: {
|
|
144
|
-
__SOME_FALSE_DEFINE__:
|
|
153
|
+
__SOME_FALSE_DEFINE__: "false",
|
|
145
154
|
},
|
|
146
155
|
}),
|
|
147
156
|
],
|
|
@@ -153,20 +162,20 @@
|
|
|
153
162
|
For example, `import` initialized by dead code will be removed:
|
|
154
163
|
|
|
155
164
|
```js
|
|
156
|
-
import { foo } from
|
|
165
|
+
import { foo } from "bar";
|
|
157
166
|
|
|
158
167
|
if (__SOME_FALSE_DEFINE__) {
|
|
159
168
|
foo();
|
|
160
|
-
console.log(
|
|
169
|
+
console.log("dead code");
|
|
161
170
|
} else {
|
|
162
|
-
console.log(
|
|
171
|
+
console.log("reachable code");
|
|
163
172
|
}
|
|
164
173
|
```
|
|
165
174
|
|
|
166
175
|
will be transformed to:
|
|
167
176
|
|
|
168
177
|
```js
|
|
169
|
-
console.log(
|
|
178
|
+
console.log("reachable code");
|
|
170
179
|
```
|
|
171
180
|
|
|
172
181
|
## 0.6.0
|
|
@@ -176,14 +185,14 @@
|
|
|
176
185
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
177
186
|
|
|
178
187
|
```js
|
|
179
|
-
import { pluginReactLynx } from
|
|
180
|
-
import { defineConfig } from
|
|
188
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
189
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
181
190
|
|
|
182
191
|
export default defineConfig({
|
|
183
192
|
plugins: [
|
|
184
193
|
pluginReactLynx({
|
|
185
194
|
compat: {
|
|
186
|
-
removeComponentAttrRegex:
|
|
195
|
+
removeComponentAttrRegex: "YOUR REGEX",
|
|
187
196
|
},
|
|
188
197
|
}),
|
|
189
198
|
],
|
|
@@ -159,6 +159,7 @@ class ReactWebpackPlugin {
|
|
|
159
159
|
const runtimeFile = require.resolve(path);
|
|
160
160
|
lepusCode.chunks.push({
|
|
161
161
|
name: 'worklet-runtime',
|
|
162
|
+
// @ts-expect-error Rspack x Webpack sources not match
|
|
162
163
|
source: new RawSource(fs.readFileSync(runtimeFile, 'utf8')),
|
|
163
164
|
info: {
|
|
164
165
|
['lynx:main-thread']: true,
|
package/lib/loaders/options.js
CHANGED
|
@@ -12,8 +12,11 @@ const PUBLIC_RUNTIME_PKG = '@lynx-js/react';
|
|
|
12
12
|
const RUNTIME_PKG = '@lynx-js/react/internal';
|
|
13
13
|
const OLD_RUNTIME_PKG = '@lynx-js/react-runtime';
|
|
14
14
|
const COMPONENT_PKG = '@lynx-js/react-components';
|
|
15
|
+
function normalizeSlashes(file) {
|
|
16
|
+
return file.replaceAll(path.win32.sep, '/');
|
|
17
|
+
}
|
|
15
18
|
function getCommonOptions() {
|
|
16
|
-
const filename = path.relative(this.rootContext, this.resourcePath);
|
|
19
|
+
const filename = normalizeSlashes(path.relative(this.rootContext, this.resourcePath));
|
|
17
20
|
const { compat, enableRemoveCSSScope, inlineSourcesContent, isDynamicComponent, defineDCE = { define: {} }, } = this.getOptions();
|
|
18
21
|
const syntax = (/\.[mc]?tsx?$/.exec(this.resourcePath))
|
|
19
22
|
? 'typescript'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-webpack-plugin-canary",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.16-canary-20250610-0a0ef409",
|
|
4
4
|
"description": "A webpack plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@microsoft/api-extractor": "7.52.8",
|
|
41
|
-
"@rspack/core": "1.3.
|
|
41
|
+
"@rspack/core": "1.3.15",
|
|
42
42
|
"css-loader": "^7.1.2",
|
|
43
43
|
"swc-loader": "^0.2.6",
|
|
44
44
|
"webpack": "^5.99.9",
|
|
45
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.109.3-canary-20250610-0a0ef409",
|
|
45
46
|
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.5.4",
|
|
46
|
-
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.7.
|
|
47
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.7.2",
|
|
47
48
|
"@lynx-js/test-tools": "0.0.0",
|
|
48
|
-
"@lynx-js/vitest-setup": "0.0.0"
|
|
49
|
-
"@lynx-js/react": "npm:@lynx-js/react-canary@0.109.1"
|
|
49
|
+
"@lynx-js/vitest-setup": "0.0.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@lynx-js/react": "*",
|