@lynx-js/react-rsbuild-plugin 0.11.0 → 0.11.2

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 (3) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/index.js +24 -14
  3. package/package.json +10 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix using wrong version of `@lynx-js/react/refresh`. ([#1756](https://github.com/lynx-family/lynx-stack/pull/1756))
8
+
9
+ - Updated dependencies []:
10
+ - @lynx-js/react-alias-rsbuild-plugin@0.11.2
11
+ - @lynx-js/use-sync-external-store@1.5.0
12
+ - @lynx-js/react-refresh-webpack-plugin@0.3.4
13
+ - @lynx-js/react-webpack-plugin@0.7.1
14
+
15
+ ## 0.11.1
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [[`19f823a`](https://github.com/lynx-family/lynx-stack/commit/19f823aae4ce6d99c173d28d157b7514ae8453cf)]:
20
+ - @lynx-js/css-extract-webpack-plugin@0.6.4
21
+ - @lynx-js/react-alias-rsbuild-plugin@0.11.1
22
+ - @lynx-js/use-sync-external-store@1.5.0
23
+ - @lynx-js/react-refresh-webpack-plugin@0.3.4
24
+ - @lynx-js/react-webpack-plugin@0.7.1
25
+
3
26
  ## 0.11.0
4
27
 
5
28
  ### Minor Changes
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import { RuntimeWrapperWebpackPlugin } from "@lynx-js/runtime-wrapper-webpack-pl
7
7
  import { LynxEncodePlugin, LynxTemplatePlugin, WebEncodePlugin } from "@lynx-js/template-webpack-plugin";
8
8
  import { ReactRefreshRspackPlugin, ReactRefreshWebpackPlugin } from "@lynx-js/react-refresh-webpack-plugin";
9
9
  var __webpack_modules__ = {
10
- "../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.2/node_modules/typia/lib/internal/_accessExpressionAsString.js": function(__unused_webpack_module, exports) {
10
+ "../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.3/node_modules/typia/lib/internal/_accessExpressionAsString.js": function(__unused_webpack_module, exports) {
11
11
  exports._accessExpressionAsString = void 0;
12
12
  const _accessExpressionAsString = (str)=>variable(str) ? `.${str}` : `[${JSON.stringify(str)}]`;
13
13
  exports._accessExpressionAsString = _accessExpressionAsString;
@@ -52,9 +52,9 @@ var __webpack_modules__ = {
52
52
  "with"
53
53
  ]);
54
54
  },
55
- "../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.2/node_modules/typia/lib/internal/_assertGuard.js": function(__unused_webpack_module, exports, __webpack_require__) {
55
+ "../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.3/node_modules/typia/lib/internal/_assertGuard.js": function(__unused_webpack_module, exports, __webpack_require__) {
56
56
  exports._assertGuard = void 0;
57
- const TypeGuardError_1 = __webpack_require__("../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.2/node_modules/typia/lib/TypeGuardError.mjs");
57
+ const TypeGuardError_1 = __webpack_require__("../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.3/node_modules/typia/lib/TypeGuardError.mjs");
58
58
  const _assertGuard = (exceptionable, props, factory)=>{
59
59
  if (true === exceptionable) if (factory) throw factory(props);
60
60
  else throw new TypeGuardError_1.TypeGuardError(props);
@@ -71,7 +71,7 @@ var __webpack_modules__ = {
71
71
  "node:url": function(module) {
72
72
  module.exports = __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__;
73
73
  },
74
- "../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.2/node_modules/typia/lib/TypeGuardError.mjs": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
74
+ "../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.3/node_modules/typia/lib/TypeGuardError.mjs": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
75
75
  __webpack_require__.r(__webpack_exports__);
76
76
  __webpack_require__.d(__webpack_exports__, {
77
77
  TypeGuardError: ()=>TypeGuardError
@@ -512,20 +512,30 @@ function applyLoaders(api, options) {
512
512
  });
513
513
  }
514
514
  const PLUGIN_NAME_REACT_REFRESH = 'lynx:react:refresh';
515
- const refresh_require = createRequire(import.meta.url);
516
515
  function applyRefresh(api) {
517
- api.modifyWebpackChain((chain, { CHAIN_ID, isProd })=>{
518
- if (!isProd) applyRefreshRules(chain, CHAIN_ID, ReactRefreshWebpackPlugin);
516
+ api.modifyWebpackChain(async (chain, { CHAIN_ID, isProd })=>{
517
+ if (!isProd) await applyRefreshRules(api, chain, CHAIN_ID, ReactRefreshWebpackPlugin);
519
518
  });
520
- api.modifyBundlerChain((chain, { isProd, CHAIN_ID })=>{
519
+ api.modifyBundlerChain(async (chain, { isProd, CHAIN_ID })=>{
521
520
  if (!isProd) {
522
- applyRefreshRules(chain, CHAIN_ID, ReactRefreshRspackPlugin);
523
- chain.resolve.alias.set('@lynx-js/react/refresh$', refresh_require.resolve('@lynx-js/react/refresh')).end();
521
+ const { resolve } = api.useExposed(Symbol.for('@lynx-js/react/internal:resolve'));
522
+ await Promise.all([
523
+ applyRefreshRules(api, chain, CHAIN_ID, ReactRefreshRspackPlugin),
524
+ resolve('@lynx-js/react/refresh').then((refresh)=>{
525
+ chain.resolve.alias.set('@lynx-js/react/refresh$', refresh);
526
+ })
527
+ ]);
524
528
  }
525
529
  });
526
530
  }
527
- function applyRefreshRules(chain, CHAIN_ID, ReactRefreshPlugin) {
528
- chain.plugin(PLUGIN_NAME_REACT_REFRESH).before(CHAIN_ID.PLUGIN.HMR).use(ReactRefreshPlugin).end().module.rule('react:refresh').issuerLayer(LAYERS.BACKGROUND).before(CHAIN_ID.RULE.JS).test(/\.[jt]sx$/).exclude.add(/node_modules/).add(external_node_path_["default"].dirname(refresh_require.resolve('@lynx-js/react/package.json'))).add(external_node_path_["default"].dirname(refresh_require.resolve('@lynx-js/react/refresh'))).add(external_node_path_["default"].dirname(refresh_require.resolve('@lynx-js/react/worklet-runtime'))).add(ReactRefreshPlugin.loader).end().use('ReactRefresh').loader(ReactRefreshPlugin.loader).options({}).end().end().end().end();
531
+ async function applyRefreshRules(api, chain, CHAIN_ID, ReactRefreshPlugin) {
532
+ const { resolve } = api.useExposed(Symbol.for('@lynx-js/react/internal:resolve'));
533
+ const [reactRuntime, refresh, workletRuntime] = await Promise.all([
534
+ resolve('@lynx-js/react/package.json'),
535
+ resolve('@lynx-js/react/refresh'),
536
+ resolve('@lynx-js/react/worklet-runtime')
537
+ ]);
538
+ chain.plugin(PLUGIN_NAME_REACT_REFRESH).before(CHAIN_ID.PLUGIN.HMR).use(ReactRefreshPlugin).end().module.rule('react:refresh').issuerLayer(LAYERS.BACKGROUND).before(CHAIN_ID.RULE.JS).test(/\.[jt]sx$/).exclude.add(/node_modules/).add(external_node_path_["default"].dirname(reactRuntime)).add(external_node_path_["default"].dirname(refresh)).add(external_node_path_["default"].dirname(workletRuntime)).add(ReactRefreshPlugin.loader).end().use('ReactRefresh').loader(ReactRefreshPlugin.loader).options({}).end().end().end().end();
529
539
  }
530
540
  const isPlainObject = (obj)=>null !== obj && 'object' == typeof obj && '[object Object]' === Object.prototype.toString.call(obj);
531
541
  const applySplitChunksRule = (api)=>{
@@ -603,8 +613,8 @@ function applyUseSyncExternalStore(api) {
603
613
  })));
604
614
  });
605
615
  }
606
- var _accessExpressionAsString = __webpack_require__("../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.2/node_modules/typia/lib/internal/_accessExpressionAsString.js");
607
- var _assertGuard = __webpack_require__("../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.2/node_modules/typia/lib/internal/_assertGuard.js");
616
+ var _accessExpressionAsString = __webpack_require__("../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.3/node_modules/typia/lib/internal/_accessExpressionAsString.js");
617
+ var _assertGuard = __webpack_require__("../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.3/node_modules/typia/lib/internal/_assertGuard.js");
608
618
  const validateConfig = (()=>{
609
619
  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.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.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.removeDescendantSelectorScope || "boolean" == typeof input.removeDescendantSelectorScope) && (void 0 === input.shake || "object" == typeof input.shake && null !== input.shake && false === Array.isArray(input.shake) && _io4(input.shake, _exceptionable)) && (void 0 === input.defineDCE || "object" == typeof input.defineDCE && null !== input.defineDCE && false === Array.isArray(input.defineDCE) && _io5(input.defineDCE, _exceptionable)) && (void 0 === input.engineVersion || "string" == typeof input.engineVersion) && (void 0 === input.targetSdkVersion || "string" == typeof input.targetSdkVersion) && null !== input.extractStr && (void 0 === input.extractStr || "boolean" == typeof input.extractStr || "object" == typeof input.extractStr && null !== input.extractStr && false === Array.isArray(input.extractStr) && _io7(input.extractStr, _exceptionable)) && (void 0 === input.experimental_isLazyBundle || "boolean" == typeof input.experimental_isLazyBundle) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
610
620
  if ([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-rsbuild-plugin",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "A rsbuild plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "rsbuild",
@@ -32,30 +32,30 @@
32
32
  "README.md"
33
33
  ],
34
34
  "dependencies": {
35
- "@lynx-js/css-extract-webpack-plugin": "0.6.3",
36
- "@lynx-js/react-alias-rsbuild-plugin": "0.11.0",
35
+ "@lynx-js/css-extract-webpack-plugin": "0.6.4",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "0.11.2",
37
37
  "@lynx-js/react-refresh-webpack-plugin": "0.3.4",
38
- "@lynx-js/react-webpack-plugin": "0.7.1",
39
38
  "@lynx-js/runtime-wrapper-webpack-plugin": "0.1.3",
40
39
  "@lynx-js/template-webpack-plugin": "0.9.0",
40
+ "@lynx-js/react-webpack-plugin": "0.7.1",
41
41
  "@lynx-js/use-sync-external-store": "1.5.0",
42
42
  "background-only": "^0.0.1"
43
43
  },
44
44
  "devDependencies": {
45
- "@microsoft/api-extractor": "7.52.13",
45
+ "@microsoft/api-extractor": "7.52.15",
46
46
  "@rollup/plugin-typescript": "^12.1.4",
47
- "@rsbuild/core": "1.5.4",
47
+ "@rsbuild/core": "1.5.13",
48
48
  "@rsbuild/plugin-sass": "1.4.0",
49
- "@rsbuild/plugin-typed-css-modules": "1.1.0",
49
+ "@rsbuild/plugin-typed-css-modules": "1.1.1",
50
50
  "rsbuild-plugin-arethetypeswrong": "0.1.1",
51
51
  "rsbuild-plugin-publint": "0.3.3",
52
52
  "tailwindcss": "^3.4.17",
53
- "type-fest": "^4.41.0",
53
+ "type-fest": "^5.0.1",
54
54
  "typia": "9.7.2",
55
55
  "typia-rspack-plugin": "2.2.2",
56
- "@lynx-js/react": "0.114.0",
56
+ "@lynx-js/react": "0.114.2",
57
57
  "@lynx-js/react-transform": "0.2.0",
58
- "@lynx-js/rspeedy": "0.11.3",
58
+ "@lynx-js/rspeedy": "0.11.6",
59
59
  "@lynx-js/vitest-setup": "0.0.0"
60
60
  },
61
61
  "peerDependencies": {