lupine.web 1.0.18 → 1.0.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lupine.web",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "license": "MIT",
5
5
  "author": "uuware.com",
6
6
  "homepage": "https://uuware.com/",
@@ -34,13 +34,22 @@ export type _LupineJs = {
34
34
  export const _lupineJs: _LupineJs = {} as _LupineJs;
35
35
 
36
36
  // for SSR, it exports _lupineJs function for the server to call
37
- if (typeof exports !== 'undefined') {
38
- // ignore esbuild's warnings:
39
- // The CommonJS "exports" variable is treated as a global variable in an ECMAScript module and may not work as expected [commonjs-variable-in-esm]
40
- exports._lupineJs = () => {
41
- return _lupineJs;
42
- };
37
+ // this should be loaded in a sandbox
38
+ if (typeof globalThis !== 'undefined') {
39
+ const gThis = globalThis as any;
40
+ if (gThis._lupineJs === null) {
41
+ gThis._lupineJs = () => {
42
+ return _lupineJs;
43
+ };
44
+ }
43
45
  }
46
+ // if (typeof exports !== 'undefined') {
47
+ // // ignore esbuild's warnings:
48
+ // // The CommonJS "exports" variable is treated as a global variable in an ECMAScript module and may not work as expected [commonjs-variable-in-esm]
49
+ // exports._lupineJs = () => {
50
+ // return _lupineJs;
51
+ // };
52
+ // }
44
53
 
45
54
  // this should be called by the FE and also by the server side to set fetchData and others for client and server side rendering.
46
55
  // And the RenderPageFunctionsType will be passed to call (generate) a page through PageProps