vite-plugin-shopify-theme-islands 1.3.1 → 1.3.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.
package/dist/index.js CHANGED
@@ -362,6 +362,16 @@ function shopifyThemeIslands(options = {}) {
362
362
  const { runtime: reviveOptions } = policy;
363
363
  const log = debug ? (...args) => console.log("[islands]", ...args) : () => {};
364
364
  const inventory = createIslandInventory(rawDirs);
365
+ let devServer = null;
366
+ const invalidateReviveModule = () => {
367
+ if (!devServer)
368
+ return;
369
+ const mod = devServer.moduleGraph.getModuleById(RESOLVED_ID);
370
+ if (!mod)
371
+ return;
372
+ devServer.moduleGraph.invalidateModule(mod);
373
+ devServer.ws.send({ type: "full-reload" });
374
+ };
365
375
  return {
366
376
  name: "vite-plugin-shopify-theme-islands",
367
377
  enforce: "pre",
@@ -371,6 +381,9 @@ function shopifyThemeIslands(options = {}) {
371
381
  aliases: config.resolve.alias
372
382
  });
373
383
  },
384
+ configureServer(server) {
385
+ devServer = server;
386
+ },
374
387
  buildStart() {
375
388
  const t0 = performance.now();
376
389
  const snapshot = inventory.scan();
@@ -406,6 +419,7 @@ function shopifyThemeIslands(options = {}) {
406
419
  const root = inventory.getRoot();
407
420
  const prefix = event === "delete" ? "Removed island (deleted):" : change.type === "detected" ? "Detected island (watchChange):" : "Removed island (watchChange):";
408
421
  log(prefix, relative2(root, change.file));
422
+ invalidateReviveModule();
409
423
  },
410
424
  resolveId(id) {
411
425
  if (id === VIRTUAL_ID)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-shopify-theme-islands",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Vite plugin for island architecture in Shopify themes",
5
5
  "type": "module",
6
6
  "packageManager": "bun@1.3.10",
@@ -10,7 +10,7 @@ description: >
10
10
  are owned by src/directive-orchestration.ts.
11
11
  type: core
12
12
  library: vite-plugin-shopify-theme-islands
13
- library_version: "1.3.1"
13
+ library_version: "1.3.2"
14
14
  sources:
15
15
  - Rees1993/vite-plugin-shopify-theme-islands:src/contract.ts
16
16
  - Rees1993/vite-plugin-shopify-theme-islands:src/directive-orchestration.ts
@@ -15,7 +15,7 @@ description: >
15
15
  owned by src/directive-orchestration.ts.
16
16
  type: core
17
17
  library: vite-plugin-shopify-theme-islands
18
- library_version: "1.3.1"
18
+ library_version: "1.3.2"
19
19
  sources:
20
20
  - Rees1993/vite-plugin-shopify-theme-islands:src/directive-orchestration.ts
21
21
  - Rees1993/vite-plugin-shopify-theme-islands:src/runtime.ts
@@ -14,7 +14,7 @@ description: >
14
14
  runtime observability and event dispatch are routed through src/runtime-surface.ts.
15
15
  type: core
16
16
  library: vite-plugin-shopify-theme-islands
17
- library_version: "1.3.1"
17
+ library_version: "1.3.2"
18
18
  sources:
19
19
  - Rees1993/vite-plugin-shopify-theme-islands:src/events.ts
20
20
  - Rees1993/vite-plugin-shopify-theme-islands:src/runtime-surface.ts
@@ -14,7 +14,7 @@ description: >
14
14
  or enabling retry / directive timeout.
15
15
  type: core
16
16
  library: vite-plugin-shopify-theme-islands
17
- library_version: "1.3.1"
17
+ library_version: "1.3.2"
18
18
  sources:
19
19
  - Rees1993/vite-plugin-shopify-theme-islands:src/index.ts
20
20
  - Rees1993/vite-plugin-shopify-theme-islands:src/contract.ts
@@ -4,12 +4,13 @@ description: >
4
4
  Writing island files. Two discovery modes: directory scanning (files in
5
5
  configured directories auto-discovered by tag name = filename) and Island
6
6
  mixin (import Island from vite-plugin-shopify-theme-islands/island to mark
7
- files anywhere in the project). Covers customElements.define, the Island
7
+ files anywhere in the project). Mixin islands added or removed during dev
8
+ trigger an automatic reload. Covers customElements.define, the Island
8
9
  base class, and child island cascade behaviour now owned by
9
10
  src/lifecycle.ts.
10
11
  type: core
11
12
  library: vite-plugin-shopify-theme-islands
12
- library_version: "1.3.1"
13
+ library_version: "1.3.2"
13
14
  sources:
14
15
  - Rees1993/vite-plugin-shopify-theme-islands:src/island.ts
15
16
  - Rees1993/vite-plugin-shopify-theme-islands:src/discovery.ts
@@ -61,7 +62,7 @@ if (!customElements.get("cart-drawer")) {
61
62
  }
62
63
  ```
63
64
 
64
- The plugin scans all TS/JS files for the `Island` import at build time and includes matches as lazy chunks.
65
+ The plugin scans all TS/JS files for the `Island` import at build time and includes matches as lazy chunks. During dev, adding or removing a mixin island file triggers an automatic reload — no Vite restart needed.
65
66
 
66
67
  ## Core Patterns
67
68