chayns-api 2.6.0-beta.8 → 2.6.0-beta.9

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.
@@ -9,6 +9,17 @@ let HydrationContext = exports.HydrationContext = void 0;
9
9
  if (!globalThis.window && globalThis._hydrationContext) {
10
10
  exports.HydrationContext = HydrationContext = globalThis._hydrationContext;
11
11
  } else {
12
- exports.HydrationContext = HydrationContext = (0, _react.createContext)({});
12
+ const emptyReadonly = new Proxy({}, {
13
+ set() {
14
+ return true;
15
+ },
16
+ defineProperty() {
17
+ return true;
18
+ },
19
+ deleteProperty() {
20
+ return true;
21
+ }
22
+ });
23
+ exports.HydrationContext = HydrationContext = (0, _react.createContext)(emptyReadonly);
13
24
  globalThis._hydrationContext = HydrationContext;
14
25
  }
@@ -9,6 +9,17 @@ let ModuleContext = exports.ModuleContext = void 0;
9
9
  if (!globalThis.window && globalThis._moduleContext) {
10
10
  exports.ModuleContext = ModuleContext = globalThis._moduleContext;
11
11
  } else {
12
- exports.ModuleContext = ModuleContext = (0, _react.createContext)({});
12
+ const emptyReadonly = new Proxy({}, {
13
+ set() {
14
+ return true;
15
+ },
16
+ defineProperty() {
17
+ return true;
18
+ },
19
+ deleteProperty() {
20
+ return true;
21
+ }
22
+ });
23
+ exports.ModuleContext = ModuleContext = (0, _react.createContext)(emptyReadonly);
13
24
  globalThis._moduleContext = ModuleContext;
14
25
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.collectCssChunks = void 0;
7
- const collectCssChunks = async modules => {
7
+ const collectCssChunks = modules => {
8
8
  const instance = globalThis.moduleFederationRuntime.getInstance();
9
9
  const p = Object.values(modules).map(module => {
10
10
  const info = instance.snapshotHandler.manifestCache.get(module.url);
@@ -3,6 +3,17 @@ export let HydrationContext;
3
3
  if (!globalThis.window && globalThis._hydrationContext) {
4
4
  HydrationContext = globalThis._hydrationContext;
5
5
  } else {
6
- HydrationContext = createContext({});
6
+ const emptyReadonly = new Proxy({}, {
7
+ set() {
8
+ return true;
9
+ },
10
+ defineProperty() {
11
+ return true;
12
+ },
13
+ deleteProperty() {
14
+ return true;
15
+ }
16
+ });
17
+ HydrationContext = createContext(emptyReadonly);
7
18
  globalThis._hydrationContext = HydrationContext;
8
19
  }
@@ -3,6 +3,17 @@ export let ModuleContext;
3
3
  if (!globalThis.window && globalThis._moduleContext) {
4
4
  ModuleContext = globalThis._moduleContext;
5
5
  } else {
6
- ModuleContext = createContext({});
6
+ const emptyReadonly = new Proxy({}, {
7
+ set() {
8
+ return true;
9
+ },
10
+ defineProperty() {
11
+ return true;
12
+ },
13
+ deleteProperty() {
14
+ return true;
15
+ }
16
+ });
17
+ ModuleContext = createContext(emptyReadonly);
7
18
  globalThis._moduleContext = ModuleContext;
8
19
  }
@@ -1,4 +1,4 @@
1
- export const collectCssChunks = async modules => {
1
+ export const collectCssChunks = modules => {
2
2
  const instance = globalThis.moduleFederationRuntime.getInstance();
3
3
  const p = Object.values(modules).map(module => {
4
4
  const info = instance.snapshotHandler.manifestCache.get(module.url);
@@ -1,2 +1,2 @@
1
1
  import { ModuleContextValueType } from '../constants';
2
- export declare const collectCssChunks: (modules: ModuleContextValueType) => Promise<string>;
2
+ export declare const collectCssChunks: (modules: ModuleContextValueType) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "2.6.0-beta.8",
3
+ "version": "2.6.0-beta.9",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",