@lynx-js/react-webpack-plugin-canary 0.6.16 → 0.6.17-canary-20250627-a7e8b5bb

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.
Files changed (2) hide show
  1. package/CHANGELOG.md +48 -12
  2. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # @lynx-js/react-webpack-plugin
2
2
 
3
+ ## 0.6.17-canary-20250627143427-a7e8b5bbbab0490e7cf6f47581130e7b32739abb
4
+
5
+ ### Patch Changes
6
+
7
+ - Enable fine-grained control for `output.inlineScripts` ([#883](https://github.com/lynx-family/lynx-stack/pull/883))
8
+
9
+ ```ts
10
+ type InlineChunkTestFunction = (params: {
11
+ size: number;
12
+ name: string;
13
+ }) => boolean;
14
+
15
+ type InlineChunkTest = RegExp | InlineChunkTestFunction;
16
+
17
+ type InlineChunkConfig =
18
+ | boolean
19
+ | InlineChunkTest
20
+ | { enable?: boolean | "auto"; test: InlineChunkTest };
21
+ ```
22
+
23
+ ```ts
24
+ import { defineConfig } from "@lynx-js/rspeedy";
25
+
26
+ export default defineConfig({
27
+ output: {
28
+ inlineScripts: ({ name, size }) => {
29
+ return name.includes("foo") && size < 1000;
30
+ },
31
+ },
32
+ });
33
+ ```
34
+
35
+ - Updated dependencies [[`e6802d7`](https://github.com/lynx-family/lynx-stack/commit/e6802d770ab5593d88c01458351ae66440807ac1), [`69fb042`](https://github.com/lynx-family/lynx-stack/commit/69fb0420e297abf768c889769c95a207c480b3c7), [`a7e8b5b`](https://github.com/lynx-family/lynx-stack/commit/a7e8b5bbbab0490e7cf6f47581130e7b32739abb)]:
36
+ - @lynx-js/react@0.110.1-canary-20250627143427-a7e8b5bbbab0490e7cf6f47581130e7b32739abb
37
+ - @lynx-js/template-webpack-plugin@0.8.1-canary-20250627143427-a7e8b5bbbab0490e7cf6f47581130e7b32739abb
38
+
3
39
  ## 0.6.16
4
40
 
5
41
  ### Patch Changes
@@ -78,7 +114,7 @@
78
114
  - Shake `useImperativeHandle` on the main-thread by default. ([#153](https://github.com/lynx-family/lynx-stack/pull/153))
79
115
 
80
116
  ```js
81
- import { forwardRef, useImperativeHandle } from '@lynx-js/react';
117
+ import { forwardRef, useImperativeHandle } from "@lynx-js/react";
82
118
 
83
119
  export default forwardRef(function App(_, ref) {
84
120
  useImperativeHandle(ref, () => {
@@ -86,7 +122,7 @@
86
122
  return {
87
123
  name() {
88
124
  // This should be considered as background only
89
- console.info('This should not exist in main-thread');
125
+ console.info("This should not exist in main-thread");
90
126
  },
91
127
  };
92
128
  });
@@ -146,14 +182,14 @@
146
182
  - e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
147
183
 
148
184
  ```js
149
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
150
- import { defineConfig } from '@lynx-js/rspeedy';
185
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
186
+ import { defineConfig } from "@lynx-js/rspeedy";
151
187
 
152
188
  export default defineConfig({
153
189
  plugins: [
154
190
  pluginReactLynx({
155
191
  defineDCE: {
156
- __SOME_FALSE_DEFINE__: 'false',
192
+ __SOME_FALSE_DEFINE__: "false",
157
193
  },
158
194
  }),
159
195
  ],
@@ -165,20 +201,20 @@
165
201
  For example, `import` initialized by dead code will be removed:
166
202
 
167
203
  ```js
168
- import { foo } from 'bar';
204
+ import { foo } from "bar";
169
205
 
170
206
  if (__SOME_FALSE_DEFINE__) {
171
207
  foo();
172
- console.log('dead code');
208
+ console.log("dead code");
173
209
  } else {
174
- console.log('reachable code');
210
+ console.log("reachable code");
175
211
  }
176
212
  ```
177
213
 
178
214
  will be transformed to:
179
215
 
180
216
  ```js
181
- console.log('reachable code');
217
+ console.log("reachable code");
182
218
  ```
183
219
 
184
220
  ## 0.6.0
@@ -188,14 +224,14 @@
188
224
  - a30c83d: Add `compat.removeComponentAttrRegex`.
189
225
 
190
226
  ```js
191
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
192
- import { defineConfig } from '@lynx-js/rspeedy';
227
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
228
+ import { defineConfig } from "@lynx-js/rspeedy";
193
229
 
194
230
  export default defineConfig({
195
231
  plugins: [
196
232
  pluginReactLynx({
197
233
  compat: {
198
- removeComponentAttrRegex: 'YOUR REGEX',
234
+ removeComponentAttrRegex: "YOUR REGEX",
199
235
  },
200
236
  }),
201
237
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-webpack-plugin-canary",
3
- "version": "0.6.16",
3
+ "version": "0.6.17-canary-20250627-a7e8b5bb",
4
4
  "description": "A webpack plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "webpack",
@@ -38,14 +38,14 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@microsoft/api-extractor": "7.52.8",
41
- "@rspack/core": "1.3.15",
41
+ "@rspack/core": "1.4.0-rc.0",
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.110.1-canary-20250627-a7e8b5bb",
45
46
  "@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.6.0",
46
- "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.8.0",
47
+ "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.8.1-canary-20250627-a7e8b5bb",
47
48
  "@lynx-js/test-tools": "0.0.0",
48
- "@lynx-js/react": "npm:@lynx-js/react-canary@0.110.0",
49
49
  "@lynx-js/vitest-setup": "0.0.0"
50
50
  },
51
51
  "peerDependencies": {