@lynx-js/react-rsbuild-plugin 0.9.1 → 0.9.3

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,40 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.9.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Support `@lynx-js/react` v0.106.0. ([#239](https://github.com/lynx-family/lynx-stack/pull/239))
8
+
9
+ - Fix the issue where the canary version of React was not included in the `rule.include` configuration. ([#275](https://github.com/lynx-family/lynx-stack/pull/275))
10
+
11
+ - Updated dependencies [[`ba26a4d`](https://github.com/lynx-family/lynx-stack/commit/ba26a4db1ec3dcfd445dd834533b3bc10b091686), [`462e97b`](https://github.com/lynx-family/lynx-stack/commit/462e97b28c12b554c0c825c7df453bdf433749ae), [`aa1fbed`](https://github.com/lynx-family/lynx-stack/commit/aa1fbedec8459f8c830467a5b92033e3530dce80), [`d2d55ef`](https://github.com/lynx-family/lynx-stack/commit/d2d55ef9fe438c35921d9db0daa40d5228822ecc), [`6af0396`](https://github.com/lynx-family/lynx-stack/commit/6af039661844f22b65ad1b98db5c7b31df204ae4)]:
12
+ - @lynx-js/template-webpack-plugin@0.6.6
13
+ - @lynx-js/react-webpack-plugin@0.6.9
14
+ - @lynx-js/runtime-wrapper-webpack-plugin@0.0.9
15
+ - @lynx-js/web-webpack-plugin@0.6.3
16
+ - @lynx-js/react-alias-rsbuild-plugin@0.9.3
17
+ - @lynx-js/css-extract-webpack-plugin@0.5.2
18
+ - @lynx-js/react-refresh-webpack-plugin@0.3.2
19
+
20
+ ## 0.9.2
21
+
22
+ ### Patch Changes
23
+
24
+ - Avoid entry IIFE in `main-thread.js` ([#206](https://github.com/lynx-family/lynx-stack/pull/206))
25
+
26
+ - Enable CSS minification for scoped CSS. ([#205](https://github.com/lynx-family/lynx-stack/pull/205))
27
+
28
+ - Should generate `.rspeedy/[name]/main-thread.js` instead of `.rspeedy/[name]__main-thread/main-thread.js` ([#180](https://github.com/lynx-family/lynx-stack/pull/180))
29
+
30
+ - Updated dependencies [[`984a51e`](https://github.com/lynx-family/lynx-stack/commit/984a51e62a42b7f3d2670189f722f0d51f9fce9b), [`5e01cef`](https://github.com/lynx-family/lynx-stack/commit/5e01cef366a20d48b430b11eedbf9e5141f316a2), [`315ba3b`](https://github.com/lynx-family/lynx-stack/commit/315ba3b7fac7872884edcdd5ef3e6d6230bbe115), [`315ba3b`](https://github.com/lynx-family/lynx-stack/commit/315ba3b7fac7872884edcdd5ef3e6d6230bbe115)]:
31
+ - @lynx-js/css-extract-webpack-plugin@0.5.2
32
+ - @lynx-js/react-webpack-plugin@0.6.8
33
+ - @lynx-js/template-webpack-plugin@0.6.5
34
+ - @lynx-js/react-alias-rsbuild-plugin@0.9.2
35
+ - @lynx-js/react-refresh-webpack-plugin@0.3.2
36
+ - @lynx-js/web-webpack-plugin@0.6.2
37
+
3
38
  ## 0.9.1
4
39
 
5
40
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
2
- import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
3
2
  import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_react_alias_rsbuild_plugin_2a0391db__ from "@lynx-js/react-alias-rsbuild-plugin";
4
3
  import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__ from "@lynx-js/react-webpack-plugin";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
5
5
  import * as __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__ from "node:url";
6
6
  import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_template_webpack_plugin_e98d2f08__ from "@lynx-js/template-webpack-plugin";
7
7
  import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_runtime_wrapper_webpack_plugin_27793081__ from "@lynx-js/runtime-wrapper-webpack-plugin";
@@ -111,7 +111,7 @@ function __webpack_require__(moduleId) {
111
111
  __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
112
112
  })();
113
113
  (()=>{
114
- __webpack_require__.r = function(exports) {
114
+ __webpack_require__.r = (exports)=>{
115
115
  if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
116
116
  value: 'Module'
117
117
  });
@@ -177,7 +177,6 @@ function applyCSS(api, options) {
177
177
  ]
178
178
  }
179
179
  ]).init((_, args)=>new CssExtractPlugin(...args)).end().end();
180
- if (true !== enableRemoveCSSScope) chain.optimization.minimizers.delete(CHAIN_ID.MINIMIZER.CSS);
181
180
  chain.module.when(void 0 === enableRemoveCSSScope, (module)=>module.rule('lynx.css.scoped').test(/\.css$/).resourceQuery({
182
181
  and: [
183
182
  /cssId/
@@ -212,7 +211,7 @@ const DEFAULT_DIST_PATH_INTERMEDIATE = '.rspeedy';
212
211
  const DEFAULT_FILENAME_HASH = '.[contenthash:8]';
213
212
  const EMPTY_HASH = '';
214
213
  function applyEntry(api, options) {
215
- const { compat, customCSSInheritanceList, debugInfoOutside, defaultDisplayLinear, enableAccessibilityElement, enableICU, enableCSSInheritance, enableCSSInvalidation, enableCSSSelector, enableNewGesture, enableParallelElement, enableRemoveCSSScope, firstScreenSyncTiming, pipelineSchedulerConfig, removeDescendantSelectorScope, targetSdkVersion, experimental_isLazyBundle } = options;
214
+ const { compat, customCSSInheritanceList, debugInfoOutside, defaultDisplayLinear, enableAccessibilityElement, enableICU, enableCSSInheritance, enableCSSInvalidation, enableCSSSelector, enableNewGesture, enableParallelElement, enableRemoveCSSScope, firstScreenSyncTiming, enableSSR, pipelineSchedulerConfig, removeDescendantSelectorScope, targetSdkVersion, experimental_isLazyBundle } = options;
216
215
  const { config } = api.useExposed(Symbol.for('rspeedy.api'));
217
216
  api.modifyBundlerChain((chain, { environment, isDev, isProd })=>{
218
217
  const entries = chain.entryPoints.entries() ?? {};
@@ -224,7 +223,7 @@ function applyEntry(api, options) {
224
223
  const { imports } = getChunks(entryName, entryPoint.values());
225
224
  const templateFilename = ('object' == typeof config.output?.filename ? config.output.filename.bundle ?? config.output.filename.template : config.output?.filename) ?? '[name].[platform].bundle';
226
225
  const mainThreadEntry = `${entryName}__main-thread`;
227
- const mainThreadName = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].posix.join(isLynx ? DEFAULT_DIST_PATH_INTERMEDIATE : '', `${mainThreadEntry}/main-thread.js`);
226
+ const mainThreadName = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].posix.join(isLynx ? DEFAULT_DIST_PATH_INTERMEDIATE : '', `${entryName}/main-thread.js`);
228
227
  const backgroundName = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].posix.join(isLynx ? DEFAULT_DIST_PATH_INTERMEDIATE : '', getBackgroundFilename(entryName, environment.config, isProd));
229
228
  const backgroundEntry = entryName;
230
229
  mainThreadChunks.push(mainThreadName);
@@ -303,7 +302,9 @@ function applyEntry(api, options) {
303
302
  {
304
303
  disableCreateSelectorQueryIncompatibleWarning: compat?.disableCreateSelectorQueryIncompatibleWarning ?? false,
305
304
  firstScreenSyncTiming,
306
- mainThreadChunks
305
+ enableSSR,
306
+ mainThreadChunks,
307
+ experimental_isLazyBundle
307
308
  }
308
309
  ]);
309
310
  });
@@ -480,7 +481,7 @@ function applySWC(api) {
480
481
  var _accessExpressionAsString = __webpack_require__("../../../node_modules/.pnpm/typia@7.6.4_@samchon+openapi@2.4.2_typescript@5.7.3/node_modules/typia/lib/internal/_accessExpressionAsString.js");
481
482
  var _assertGuard = __webpack_require__("../../../node_modules/.pnpm/typia@7.6.4_@samchon+openapi@2.4.2_typescript@5.7.3/node_modules/typia/lib/internal/_assertGuard.js");
482
483
  const validateConfig = (()=>{
483
- const _io0 = (input, _exceptionable = true)=>(void 0 === input.compat || "object" == typeof input.compat && null !== input.compat && false === Array.isArray(input.compat) && _io1(input.compat, _exceptionable)) && (void 0 === input.customCSSInheritanceList || Array.isArray(input.customCSSInheritanceList) && input.customCSSInheritanceList.every((elem, _index1)=>"string" == typeof elem)) && (void 0 === input.debugInfoOutside || "boolean" == typeof input.debugInfoOutside) && (void 0 === input.defaultDisplayLinear || "boolean" == typeof input.defaultDisplayLinear) && (void 0 === input.enableAccessibilityElement || "boolean" == typeof input.enableAccessibilityElement) && (void 0 === input.enableICU || "boolean" == typeof input.enableICU) && (void 0 === input.enableCSSInheritance || "boolean" == typeof input.enableCSSInheritance) && (void 0 === input.enableCSSInvalidation || "boolean" == typeof input.enableCSSInvalidation) && (void 0 === input.enableCSSSelector || "boolean" == typeof input.enableCSSSelector) && (void 0 === input.enableNewGesture || "boolean" == typeof input.enableNewGesture) && (void 0 === input.enableParallelElement || "boolean" == typeof input.enableParallelElement) && (void 0 === input.enableRemoveCSSScope || "boolean" == typeof input.enableRemoveCSSScope) && (void 0 === input.firstScreenSyncTiming || "immediately" === input.firstScreenSyncTiming || "jsReady" === input.firstScreenSyncTiming) && (void 0 === input.jsx || "object" == typeof input.jsx && null !== input.jsx && false === Array.isArray(input.jsx) && _io4(input.jsx, _exceptionable)) && (void 0 === input.pipelineSchedulerConfig || "number" == typeof input.pipelineSchedulerConfig) && (void 0 === input.removeDescendantSelectorScope || "boolean" == typeof input.removeDescendantSelectorScope) && (void 0 === input.shake || "object" == typeof input.shake && null !== input.shake && false === Array.isArray(input.shake) && _io5(input.shake, _exceptionable)) && (void 0 === input.defineDCE || "object" == typeof input.defineDCE && null !== input.defineDCE && false === Array.isArray(input.defineDCE) && _io6(input.defineDCE, _exceptionable)) && (void 0 === input.engineVersion || "string" == typeof input.engineVersion) && (void 0 === input.targetSdkVersion || "string" == typeof input.targetSdkVersion) && (void 0 === input.experimental_isLazyBundle || "boolean" == typeof input.experimental_isLazyBundle) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
484
+ const _io0 = (input, _exceptionable = true)=>(void 0 === input.compat || "object" == typeof input.compat && null !== input.compat && false === Array.isArray(input.compat) && _io1(input.compat, _exceptionable)) && (void 0 === input.customCSSInheritanceList || Array.isArray(input.customCSSInheritanceList) && input.customCSSInheritanceList.every((elem, _index1)=>"string" == typeof elem)) && (void 0 === input.debugInfoOutside || "boolean" == typeof input.debugInfoOutside) && (void 0 === input.defaultDisplayLinear || "boolean" == typeof input.defaultDisplayLinear) && (void 0 === input.enableAccessibilityElement || "boolean" == typeof input.enableAccessibilityElement) && (void 0 === input.enableICU || "boolean" == typeof input.enableICU) && (void 0 === input.enableCSSInheritance || "boolean" == typeof input.enableCSSInheritance) && (void 0 === input.enableCSSInvalidation || "boolean" == typeof input.enableCSSInvalidation) && (void 0 === input.enableCSSSelector || "boolean" == typeof input.enableCSSSelector) && (void 0 === input.enableNewGesture || "boolean" == typeof input.enableNewGesture) && (void 0 === input.enableParallelElement || "boolean" == typeof input.enableParallelElement) && (void 0 === input.enableRemoveCSSScope || "boolean" == typeof input.enableRemoveCSSScope) && (void 0 === input.firstScreenSyncTiming || "immediately" === input.firstScreenSyncTiming || "jsReady" === input.firstScreenSyncTiming) && (void 0 === input.enableSSR || "boolean" == typeof input.enableSSR) && (void 0 === input.jsx || "object" == typeof input.jsx && null !== input.jsx && false === Array.isArray(input.jsx) && _io4(input.jsx, _exceptionable)) && (void 0 === input.pipelineSchedulerConfig || "number" == typeof input.pipelineSchedulerConfig) && (void 0 === input.removeDescendantSelectorScope || "boolean" == typeof input.removeDescendantSelectorScope) && (void 0 === input.shake || "object" == typeof input.shake && null !== input.shake && false === Array.isArray(input.shake) && _io5(input.shake, _exceptionable)) && (void 0 === input.defineDCE || "object" == typeof input.defineDCE && null !== input.defineDCE && false === Array.isArray(input.defineDCE) && _io6(input.defineDCE, _exceptionable)) && (void 0 === input.engineVersion || "string" == typeof input.engineVersion) && (void 0 === input.targetSdkVersion || "string" == typeof input.targetSdkVersion) && (void 0 === input.experimental_isLazyBundle || "boolean" == typeof input.experimental_isLazyBundle) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
484
485
  if ([
485
486
  "compat",
486
487
  "customCSSInheritanceList",
@@ -495,6 +496,7 @@ const validateConfig = (()=>{
495
496
  "enableParallelElement",
496
497
  "enableRemoveCSSScope",
497
498
  "firstScreenSyncTiming",
499
+ "enableSSR",
498
500
  "jsx",
499
501
  "pipelineSchedulerConfig",
500
502
  "removeDescendantSelectorScope",
@@ -655,6 +657,11 @@ const validateConfig = (()=>{
655
657
  path: _path + ".firstScreenSyncTiming",
656
658
  expected: "(\"immediately\" | \"jsReady\" | undefined)",
657
659
  value: input.firstScreenSyncTiming
660
+ }, _errorFactory)) && (void 0 === input.enableSSR || "boolean" == typeof input.enableSSR || _assertGuard._assertGuard(_exceptionable, {
661
+ method: "typia.createAssertEquals",
662
+ path: _path + ".enableSSR",
663
+ expected: "(boolean | undefined)",
664
+ value: input.enableSSR
658
665
  }, _errorFactory)) && (void 0 === input.jsx || ("object" == typeof input.jsx && null !== input.jsx && false === Array.isArray(input.jsx) || _assertGuard._assertGuard(_exceptionable, {
659
666
  method: "typia.createAssertEquals",
660
667
  path: _path + ".jsx",
@@ -725,6 +732,7 @@ const validateConfig = (()=>{
725
732
  "enableParallelElement",
726
733
  "enableRemoveCSSScope",
727
734
  "firstScreenSyncTiming",
735
+ "enableSSR",
728
736
  "jsx",
729
737
  "pipelineSchedulerConfig",
730
738
  "removeDescendantSelectorScope",
@@ -1081,6 +1089,7 @@ function pluginReactLynx(userOptions) {
1081
1089
  enableParallelElement: true,
1082
1090
  enableRemoveCSSScope: true,
1083
1091
  firstScreenSyncTiming: 'immediately',
1092
+ enableSSR: false,
1084
1093
  jsx: void 0,
1085
1094
  pipelineSchedulerConfig: 0x00010000,
1086
1095
  removeDescendantSelectorScope: true,
@@ -1109,13 +1118,6 @@ function pluginReactLynx(userOptions) {
1109
1118
  applySplitChunksRule(api);
1110
1119
  applySWC(api);
1111
1120
  api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>{
1112
- config = mergeRsbuildConfig(config, {
1113
- source: {
1114
- include: [
1115
- __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname(require.resolve('@lynx-js/react/package.json'))
1116
- ]
1117
- }
1118
- });
1119
1121
  const userConfig = api.getRsbuildConfig('original');
1120
1122
  if (void 0 === userConfig.source?.include) return mergeRsbuildConfig(config, {
1121
1123
  source: {
@@ -1,6 +1,6 @@
1
1
  function ignoreCssLoader(source) {
2
2
  this.cacheable(true);
3
- if (source.includes('___CSS_LOADER_EXPORT___')) return '';
3
+ if (source.includes('___CSS_LOADER_EXPORT___')) return 'export {}';
4
4
  return source;
5
5
  }
6
6
  export { ignoreCssLoader as default };
@@ -179,6 +179,14 @@ export interface PluginReactLynxOptions {
179
179
  * @defaultValue "immediately"
180
180
  */
181
181
  firstScreenSyncTiming?: 'immediately' | 'jsReady';
182
+ /**
183
+ * `enableSSR` enable Lynx SSR feature for this build.
184
+ *
185
+ * @defaultValue `false`
186
+ *
187
+ * @public
188
+ */
189
+ enableSSR?: boolean;
182
190
  /**
183
191
  * The `jsx` option controls how JSX is transformed.
184
192
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-rsbuild-plugin",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": "A rsbuild plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "rsbuild",
@@ -32,32 +32,32 @@
32
32
  "README.md"
33
33
  ],
34
34
  "dependencies": {
35
- "@lynx-js/css-extract-webpack-plugin": "0.5.1",
36
- "@lynx-js/react-alias-rsbuild-plugin": "0.9.1",
35
+ "@lynx-js/css-extract-webpack-plugin": "0.5.2",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "0.9.3",
37
+ "@lynx-js/react-webpack-plugin": "0.6.9",
37
38
  "@lynx-js/react-refresh-webpack-plugin": "0.3.2",
38
- "@lynx-js/react-webpack-plugin": "0.6.7",
39
- "@lynx-js/runtime-wrapper-webpack-plugin": "0.0.8",
40
- "@lynx-js/template-webpack-plugin": "0.6.4",
41
- "@lynx-js/web-webpack-plugin": "0.6.2"
39
+ "@lynx-js/runtime-wrapper-webpack-plugin": "0.0.9",
40
+ "@lynx-js/template-webpack-plugin": "0.6.6",
41
+ "@lynx-js/web-webpack-plugin": "0.6.3"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@microsoft/api-extractor": "7.51.1",
45
45
  "@rollup/plugin-typescript": "^12.1.2",
46
- "@rsbuild/core": "1.2.15",
46
+ "@rsbuild/core": "1.2.19",
47
47
  "@rsbuild/plugin-sass": "1.2.2",
48
48
  "@rsbuild/plugin-typed-css-modules": "1.0.2",
49
- "@rsbuild/plugin-webpack-swc": "1.0.11",
49
+ "@rsbuild/plugin-webpack-swc": "1.0.12",
50
50
  "@rsbuild/webpack": "1.2.3",
51
51
  "tailwindcss": "^3.4.17",
52
52
  "type-fest": "^4.37.0",
53
53
  "typia": "7.6.4",
54
54
  "typia-rspack-plugin": "^1.0.2",
55
- "@lynx-js/react": "0.105.1",
56
- "@lynx-js/vitest-setup": "0.0.0",
57
- "@lynx-js/rspeedy": "0.8.3"
55
+ "@lynx-js/react": "0.106.0",
56
+ "@lynx-js/rspeedy": "0.8.5",
57
+ "@lynx-js/vitest-setup": "0.0.0"
58
58
  },
59
59
  "peerDependencies": {
60
- "@lynx-js/react": "^0.103.0 || ^0.104.0 || ^0.105.0"
60
+ "@lynx-js/react": "^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0"
61
61
  },
62
62
  "peerDependenciesMeta": {
63
63
  "@lynx-js/react": {