@octanejs/rspack-plugin 0.1.14 → 0.1.15

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/README.md CHANGED
@@ -46,6 +46,17 @@ Set `transpile: false` when an existing rule already strips TypeScript. Set
46
46
  `hmr: false` to disable Octane HMR codegen even when Rspack HMR is active.
47
47
  Set `profile: true` to produce a client profiling build; server compilations
48
48
  always keep profiling disabled.
49
+
50
+ Set `strong: true` to reject state updates during rendering, state updates from
51
+ effects, and ref writes during rendering in your application code:
52
+
53
+ ```js
54
+ new OctaneRspackPlugin({ strong: true });
55
+ ```
56
+
57
+ Dependencies keep their existing behavior. Any module can opt in on its own by
58
+ putting `"use strong"` before its imports.
59
+
49
60
  The experimental `renderers` option accepts the same declarative registry,
50
61
  filename rules, and module/export boundary metadata as `compiler.renderers` in
51
62
  Octane app config:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octanejs/rspack-plugin",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "engines": {
@@ -45,13 +45,13 @@
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@rspack/core": "^2.0.0",
48
- "octane": "0.1.19"
48
+ "octane": "0.1.20"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@rspack/core": "^2.1.4",
52
52
  "@types/node": "^24.13.3",
53
53
  "vitest": "^4.1.10",
54
- "octane": "0.1.19"
54
+ "octane": "0.1.20"
55
55
  },
56
56
  "scripts": {
57
57
  "test": "vitest run --config vitest.config.js"
package/src/loader.js CHANGED
@@ -110,6 +110,7 @@ export default function octaneLoader(source, inputSourceMap) {
110
110
  const compiler = createOctaneCompiler({
111
111
  root,
112
112
  profile,
113
+ ...(options.strong === undefined ? null : { strong: options.strong }),
113
114
  ...(options.exclude === undefined ? null : { exclude: options.exclude }),
114
115
  ...(compilerOptions.renderers === undefined
115
116
  ? null
package/src/plugin.js CHANGED
@@ -102,6 +102,7 @@ function createDiscoveryCompiler(options, root, profile, specialization) {
102
102
  return createOctaneCompiler({
103
103
  root,
104
104
  profile,
105
+ ...(options.strong === undefined ? null : { strong: options.strong }),
105
106
  ...(options.exclude === undefined ? null : { exclude: options.exclude }),
106
107
  ...(renderers === undefined ? null : { renderers }),
107
108
  ...(universalRuntime === undefined ? null : { universalRuntime }),
@@ -283,6 +284,7 @@ export class OctaneRspackPlugin {
283
284
  hmr,
284
285
  dev,
285
286
  profile,
287
+ strong: this.options.strong === true,
286
288
  exclude: this.options.exclude ?? [],
287
289
  renderers: this.options.renderers?.signature,
288
290
  runtime: this.options.runtime,
@@ -316,6 +318,7 @@ export class OctaneRspackPlugin {
316
318
  root,
317
319
  environment,
318
320
  profile,
321
+ ...(this.options.strong === undefined ? null : { strong: this.options.strong }),
319
322
  ...(this.options.hmr === undefined ? null : { hmr: this.options.hmr }),
320
323
  ...(this.options.dev === undefined ? null : { dev: this.options.dev }),
321
324
  ...(this.options.exclude === undefined ? null : { exclude: this.options.exclude }),
package/src/shared.js CHANGED
@@ -40,6 +40,7 @@ const LOADER_OPTION_KEYS = new Set([
40
40
  'hmr',
41
41
  'dev',
42
42
  'profile',
43
+ 'strong',
43
44
  'exclude',
44
45
  'renderers',
45
46
  'requireDirective',
@@ -177,6 +178,7 @@ function normalizeOptions(value, plugin) {
177
178
  assertBooleanOption(options, 'hmr');
178
179
  assertBooleanOption(options, 'dev');
179
180
  assertBooleanOption(options, 'profile');
181
+ assertBooleanOption(options, 'strong');
180
182
  assertBooleanOption(options, 'requireDirective');
181
183
  if (
182
184
  options.exclude !== undefined &&
@@ -196,6 +198,7 @@ function normalizeOptions(value, plugin) {
196
198
  ...(options.hmr === undefined ? null : { hmr: options.hmr }),
197
199
  ...(options.dev === undefined ? null : { dev: options.dev }),
198
200
  ...(options.profile === undefined ? null : { profile: options.profile }),
201
+ ...(options.strong === undefined ? null : { strong: options.strong }),
199
202
  ...(options.exclude === undefined ? null : { exclude: [...options.exclude] }),
200
203
  ...(renderers === undefined ? null : { renderers }),
201
204
  ...(universalRuntime === undefined ? null : { universalRuntime }),
package/types/index.d.ts CHANGED
@@ -112,6 +112,12 @@ export interface OctaneRspackLoaderOptions {
112
112
  dev?: boolean;
113
113
  /** Emit client profiling metadata and enable the profiling runtime. Default `false`. */
114
114
  profile?: boolean;
115
+ /**
116
+ * Enable Strong-mode compiler rules for project-owned modules. Dependencies
117
+ * remain compatible unless their own module begins with `"use strong"`.
118
+ * @default false
119
+ */
120
+ strong?: boolean;
115
121
  /**
116
122
  * Path fragments excluded from the plain `.ts`/`.js` hook-slot pass. With
117
123
  * `requireDirective`, excluded paths are exempt from Octane ownership
@@ -1,6 +1,7 @@
1
1
  import type { OctaneRspackLoaderOptions, OctaneRspackPluginOptions } from './index.js';
2
2
 
3
3
  const loaderOptions: OctaneRspackLoaderOptions = {
4
+ strong: true,
4
5
  layerSpecializations: {
5
6
  'native:main': {
6
7
  renderers: {
@@ -19,6 +20,7 @@ const loaderOptions: OctaneRspackLoaderOptions = {
19
20
  };
20
21
 
21
22
  const pluginOptions: OctaneRspackPluginOptions = {
23
+ strong: false,
22
24
  layerSpecializations: {
23
25
  'native:main': {
24
26
  runtime: '@fixture/native-main-runtime',