lupine.web 1.0.17 → 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.17",
3
+ "version": "1.0.19",
4
4
  "license": "MIT",
5
5
  "author": "uuware.com",
6
6
  "homepage": "https://uuware.com/",
@@ -159,10 +159,11 @@ if (typeof document !== 'undefined') {
159
159
  });
160
160
  }
161
161
 
162
- const clearGlobalStyles = () => {
163
- // reset unique id
164
- _globalStyle.clear();
165
- };
162
+ // 不能清空,在index.tsx中加载的只会被加载一次,清空了就没有了
163
+ // const clearGlobalStyles = () => {
164
+ // // reset unique id
165
+ // _globalStyle.clear();
166
+ // };
166
167
  // bindPageResetEvent(clearGlobalStyles);
167
168
 
168
169
  export const generateAllGlobalStyles = () => {
@@ -175,6 +176,6 @@ export const generateAllGlobalStyles = () => {
175
176
  result.push(`<style id="sty-${uniqueStyleId}">${cssText}</style>`);
176
177
  }
177
178
 
178
- clearGlobalStyles();
179
+ // clearGlobalStyles();
179
180
  return result.join('');
180
181
  };
@@ -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