@ethisyscore/vite-plugin 1.111.0 → 1.113.0
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.cjs +34 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -6
- package/dist/index.d.ts +14 -6
- package/dist/index.js +34 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -399,12 +399,20 @@ declare function parsePlatformReactPages(manifestPath: string, options?: ParsePl
|
|
|
399
399
|
*/
|
|
400
400
|
declare const PLATFORM_REACT_EXTERNALS: readonly string[];
|
|
401
401
|
/**
|
|
402
|
-
* Bundled deps that MUST resolve to a single copy. When a bundled dep
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
402
|
+
* Bundled deps that MUST resolve to a single copy. When a bundled dep is
|
|
403
|
+
* imported by BOTH the plugin's own hooks and the SDK foundation (aliased
|
|
404
|
+
* cross-repo to a sibling `dist`), the bundler otherwise resolves two copies —
|
|
405
|
+
* one per repo's `node_modules`. Two module instances = two React contexts, so
|
|
406
|
+
* a provider in one is invisible to a consumer in the other (the classic
|
|
407
|
+
* "No QueryClient set"). Pin them to one copy.
|
|
408
|
+
*
|
|
409
|
+
* `@tanstack/react-query` was the worked example of that failure and used to
|
|
410
|
+
* head this list. It is now a host external instead, which is strictly stronger:
|
|
411
|
+
* an external is never resolved into the bundle from any `node_modules` at all,
|
|
412
|
+
* so the two-copies-in-one-bundle case dedupe existed to prevent cannot arise.
|
|
413
|
+
* The entry would be inert, not protective — Vite's `resolve.dedupe` only steers
|
|
414
|
+
* resolution of specifiers that are actually being bundled. Keeping it would
|
|
415
|
+
* read as though it were still load-bearing.
|
|
408
416
|
*/
|
|
409
417
|
declare const PLATFORM_REACT_DEDUPE: readonly string[];
|
|
410
418
|
/** A `resolve.alias` entry (string or regex find), as Vite accepts. */
|
package/dist/index.d.ts
CHANGED
|
@@ -399,12 +399,20 @@ declare function parsePlatformReactPages(manifestPath: string, options?: ParsePl
|
|
|
399
399
|
*/
|
|
400
400
|
declare const PLATFORM_REACT_EXTERNALS: readonly string[];
|
|
401
401
|
/**
|
|
402
|
-
* Bundled deps that MUST resolve to a single copy. When a bundled dep
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
402
|
+
* Bundled deps that MUST resolve to a single copy. When a bundled dep is
|
|
403
|
+
* imported by BOTH the plugin's own hooks and the SDK foundation (aliased
|
|
404
|
+
* cross-repo to a sibling `dist`), the bundler otherwise resolves two copies —
|
|
405
|
+
* one per repo's `node_modules`. Two module instances = two React contexts, so
|
|
406
|
+
* a provider in one is invisible to a consumer in the other (the classic
|
|
407
|
+
* "No QueryClient set"). Pin them to one copy.
|
|
408
|
+
*
|
|
409
|
+
* `@tanstack/react-query` was the worked example of that failure and used to
|
|
410
|
+
* head this list. It is now a host external instead, which is strictly stronger:
|
|
411
|
+
* an external is never resolved into the bundle from any `node_modules` at all,
|
|
412
|
+
* so the two-copies-in-one-bundle case dedupe existed to prevent cannot arise.
|
|
413
|
+
* The entry would be inert, not protective — Vite's `resolve.dedupe` only steers
|
|
414
|
+
* resolution of specifiers that are actually being bundled. Keeping it would
|
|
415
|
+
* read as though it were still load-bearing.
|
|
408
416
|
*/
|
|
409
417
|
declare const PLATFORM_REACT_DEDUPE: readonly string[];
|
|
410
418
|
/** A `resolve.alias` entry (string or regex find), as Vite accepts. */
|
package/dist/index.js
CHANGED
|
@@ -938,10 +938,42 @@ var PLATFORM_REACT_EXTERNALS = [
|
|
|
938
938
|
"date-fns",
|
|
939
939
|
"@ethisyscore/components-react",
|
|
940
940
|
"@ethisyscore/extension-runtime",
|
|
941
|
-
"@ethisyscore/extension-runtime/plugin"
|
|
941
|
+
"@ethisyscore/extension-runtime/plugin",
|
|
942
|
+
// Externalised, not bundled, and not merely to save weight: bundling it gave
|
|
943
|
+
// every page its OWN `QueryClient`, so a mutation on the detail page
|
|
944
|
+
// invalidated a cache the list page could not see and a deleted row survived
|
|
945
|
+
// until a browser reload. One host-realm module instance is one cache across
|
|
946
|
+
// every plugin surface.
|
|
947
|
+
//
|
|
948
|
+
// Requires a host whose `hostModuleRegistry` serves this specifier: an external
|
|
949
|
+
// the deployed host does NOT register is an unresolvable bare import, and the
|
|
950
|
+
// bundle fails to load before any plugin code runs. That is the whole reason
|
|
951
|
+
// the host ships first and plugins rebuild last. The SDK's fallback (see
|
|
952
|
+
// `useSurfaceQueryClient` in plugin-ui) covers the softer case — module served,
|
|
953
|
+
// no client in scope — and cannot cover this one.
|
|
954
|
+
//
|
|
955
|
+
// THE SECOND GATE, and it binds each plugin rather than the estate: one cache
|
|
956
|
+
// means one KEY SPACE, so two owners using the same key now read each other's
|
|
957
|
+
// entry. Measured across the estate before this change: `["currencies"]` is
|
|
958
|
+
// used verbatim by coreconnect-web, bf-hr and bf-legal, from a copied
|
|
959
|
+
// `useCurrencies.ts` — three owners, one key, previously harmless only because
|
|
960
|
+
// each bundle had a cache of its own.
|
|
961
|
+
//
|
|
962
|
+
// A plugin therefore joins the shared cache the moment it is REBUILT on this
|
|
963
|
+
// SDK, and must have owner-namespaced its keys first. That ordering is the
|
|
964
|
+
// enforcement point and it is per plugin: a plugin not yet rebuilt still has
|
|
965
|
+
// its own cache and is unaffected, so this can be rolled out one plugin at a
|
|
966
|
+
// time rather than estate-wide.
|
|
967
|
+
//
|
|
968
|
+
// The ORGANISATION axis needs nothing here, and that was checked rather than
|
|
969
|
+
// assumed: coreconnect-web's AuthContext calls `queryClient.clear()` on logout
|
|
970
|
+
// AND on a live org switch between two non-null tenants, then bumps the
|
|
971
|
+
// authority epoch to force a remount. Plugins sharing that client inherit both.
|
|
972
|
+
// Sharing is in fact stricter than the status quo, where a plugin's private
|
|
973
|
+
// cache is unreachable by the host's teardown.
|
|
974
|
+
"@tanstack/react-query"
|
|
942
975
|
];
|
|
943
976
|
var PLATFORM_REACT_DEDUPE = [
|
|
944
|
-
"@tanstack/react-query",
|
|
945
977
|
"react",
|
|
946
978
|
"react-dom",
|
|
947
979
|
"@ethisyscore/extension-runtime"
|