@lynx-js/react-webpack-plugin-canary 0.7.3 → 0.7.4-canary-20260205-d924b6a3

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,11 @@
1
1
  # @lynx-js/react-webpack-plugin
2
2
 
3
+ ## 0.7.4-canary-20260205061929-d924b6a3bf3121ad45a62a832827aa39e634d5c3
4
+
5
+ ### Patch Changes
6
+
7
+ - Remove element api calls alog by default, and only enable it when `__ALOG_ELEMENT_API__` is defined to `true` or environment variable `REACT_ALOG_ELEMENT_API` is set to `true`. ([#2192](https://github.com/lynx-family/lynx-stack/pull/2192))
8
+
3
9
  ## 0.7.3
4
10
 
5
11
  ### Patch Changes
@@ -66,16 +72,16 @@
66
72
  type InlineChunkConfig =
67
73
  | boolean
68
74
  | InlineChunkTest
69
- | { enable?: boolean | 'auto'; test: InlineChunkTest };
75
+ | { enable?: boolean | "auto"; test: InlineChunkTest };
70
76
  ```
71
77
 
72
78
  ```ts
73
- import { defineConfig } from '@lynx-js/rspeedy';
79
+ import { defineConfig } from "@lynx-js/rspeedy";
74
80
 
75
81
  export default defineConfig({
76
82
  output: {
77
83
  inlineScripts: ({ name, size }) => {
78
- return name.includes('foo') && size < 1000;
84
+ return name.includes("foo") && size < 1000;
79
85
  },
80
86
  },
81
87
  });
@@ -159,7 +165,7 @@
159
165
  - Shake `useImperativeHandle` on the main-thread by default. ([#153](https://github.com/lynx-family/lynx-stack/pull/153))
160
166
 
161
167
  ```js
162
- import { forwardRef, useImperativeHandle } from '@lynx-js/react';
168
+ import { forwardRef, useImperativeHandle } from "@lynx-js/react";
163
169
 
164
170
  export default forwardRef(function App(_, ref) {
165
171
  useImperativeHandle(ref, () => {
@@ -167,7 +173,7 @@
167
173
  return {
168
174
  name() {
169
175
  // This should be considered as background only
170
- console.info('This should not exist in main-thread');
176
+ console.info("This should not exist in main-thread");
171
177
  },
172
178
  };
173
179
  });
@@ -227,14 +233,14 @@
227
233
  - e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
228
234
 
229
235
  ```js
230
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
231
- import { defineConfig } from '@lynx-js/rspeedy';
236
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
237
+ import { defineConfig } from "@lynx-js/rspeedy";
232
238
 
233
239
  export default defineConfig({
234
240
  plugins: [
235
241
  pluginReactLynx({
236
242
  defineDCE: {
237
- __SOME_FALSE_DEFINE__: 'false',
243
+ __SOME_FALSE_DEFINE__: "false",
238
244
  },
239
245
  }),
240
246
  ],
@@ -246,20 +252,20 @@
246
252
  For example, `import` initialized by dead code will be removed:
247
253
 
248
254
  ```js
249
- import { foo } from 'bar';
255
+ import { foo } from "bar";
250
256
 
251
257
  if (__SOME_FALSE_DEFINE__) {
252
258
  foo();
253
- console.log('dead code');
259
+ console.log("dead code");
254
260
  } else {
255
- console.log('reachable code');
261
+ console.log("reachable code");
256
262
  }
257
263
  ```
258
264
 
259
265
  will be transformed to:
260
266
 
261
267
  ```js
262
- console.log('reachable code');
268
+ console.log("reachable code");
263
269
  ```
264
270
 
265
271
  ## 0.6.0
@@ -269,14 +275,14 @@
269
275
  - a30c83d: Add `compat.removeComponentAttrRegex`.
270
276
 
271
277
  ```js
272
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
273
- import { defineConfig } from '@lynx-js/rspeedy';
278
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
279
+ import { defineConfig } from "@lynx-js/rspeedy";
274
280
 
275
281
  export default defineConfig({
276
282
  plugins: [
277
283
  pluginReactLynx({
278
284
  compat: {
279
- removeComponentAttrRegex: 'YOUR REGEX',
285
+ removeComponentAttrRegex: "YOUR REGEX",
280
286
  },
281
287
  }),
282
288
  ],
@@ -109,6 +109,8 @@ class ReactWebpackPlugin {
109
109
  ?? compiler.options.mode === 'development'),
110
110
  // User can enable ALog by environment variable `REACT_ALOG=true`
111
111
  __ALOG__: JSON.stringify(Boolean(process.env['REACT_ALOG'])),
112
+ // User can enable ALog of element API calls by environment variable `REACT_ALOG_ELEMENT_API=true`
113
+ __ALOG_ELEMENT_API__: JSON.stringify(Boolean(process.env['REACT_ALOG_ELEMENT_API'])),
112
114
  __EXTRACT_STR__: JSON.stringify(Boolean(options.extractStr)),
113
115
  __FIRST_SCREEN_SYNC_TIMING__: JSON.stringify(options.firstScreenSyncTiming),
114
116
  __ENABLE_SSR__: JSON.stringify(options.enableSSR),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-webpack-plugin-canary",
3
- "version": "0.7.3",
3
+ "version": "0.7.4-canary-20260205-d924b6a3",
4
4
  "description": "A webpack plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "webpack",
@@ -37,16 +37,16 @@
37
37
  "tiny-invariant": "^1.3.3"
38
38
  },
39
39
  "devDependencies": {
40
- "@microsoft/api-extractor": "7.52.15",
41
- "@rspack/core": "1.6.6",
42
- "css-loader": "^7.1.2",
43
- "swc-loader": "^0.2.6",
44
- "webpack": "^5.102.0",
40
+ "@microsoft/api-extractor": "7.55.2",
41
+ "@rspack/core": "1.7.4",
42
+ "css-loader": "^7.1.3",
43
+ "swc-loader": "^0.2.7",
44
+ "webpack": "^5.104.1",
45
45
  "@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.7.0",
46
- "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.10.0",
47
- "@lynx-js/test-tools": "0.0.0",
46
+ "@lynx-js/react": "npm:@lynx-js/react-canary@0.116.3-canary-20260205-d924b6a3",
47
+ "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.10.3",
48
48
  "@lynx-js/vitest-setup": "0.0.0",
49
- "@lynx-js/react": "npm:@lynx-js/react-canary@0.115.1"
49
+ "@lynx-js/test-tools": "0.0.0"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@lynx-js/template-webpack-plugin": "*"