@modern-js/runtime 0.0.0-nightly-20240101170614 → 0.0.0-nightly-20240103170618

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.
@@ -154,24 +154,20 @@ const ssrPlugin = () => ({
154
154
  },
155
155
  modifyEntryRuntimePlugins({ entrypoint, plugins, bundlerConfigs }) {
156
156
  if (ssrConfigMap.get(entrypoint.entryName)) {
157
- var _bundlerConfigs_find_output, _bundlerConfigs_find, _config_server, _config_server1;
157
+ var _bundlerConfigs_find_output, _bundlerConfigs_find;
158
158
  const chunkLoadingGlobal = bundlerConfigs === null || bundlerConfigs === void 0 ? void 0 : (_bundlerConfigs_find = bundlerConfigs.find((config2) => config2.name === "client")) === null || _bundlerConfigs_find === void 0 ? void 0 : (_bundlerConfigs_find_output = _bundlerConfigs_find.output) === null || _bundlerConfigs_find_output === void 0 ? void 0 : _bundlerConfigs_find_output.chunkLoadingGlobal;
159
159
  const config = api.useResolvedConfigContext();
160
160
  const { enableInlineScripts, enableInlineStyles } = config.output;
161
161
  const { crossorigin, scriptLoading } = config.html;
162
- const disablePrerender = typeof ((_config_server = config.server) === null || _config_server === void 0 ? void 0 : _config_server.ssr) === "object" ? Boolean(config.server.ssr.disablePrerender) : false;
163
- const unsafeHeaders = typeof ((_config_server1 = config.server) === null || _config_server1 === void 0 ? void 0 : _config_server1.ssr) === "object" ? config.server.ssr.unsafeHeaders : void 0;
164
162
  plugins.push({
165
163
  name: PLUGIN_IDENTIFIER,
166
164
  options: JSON.stringify({
165
+ scriptLoading,
167
166
  ...ssrConfigMap.get(entrypoint.entryName) || {},
168
167
  crossorigin,
169
- scriptLoading,
170
168
  chunkLoadingGlobal,
171
- disablePrerender,
172
169
  enableInlineScripts: typeof enableInlineScripts === "function" ? void 0 : enableInlineScripts,
173
- enableInlineStyles: typeof enableInlineStyles === "function" ? void 0 : enableInlineStyles,
174
- unsafeHeaders
170
+ enableInlineStyles: typeof enableInlineStyles === "function" ? void 0 : enableInlineStyles
175
171
  })
176
172
  });
177
173
  }
@@ -105,7 +105,8 @@ class LoadableCollector {
105
105
  const { scriptLoading = "defer", enableInlineScripts } = config;
106
106
  const scriptLoadingAtr = {
107
107
  defer: scriptLoading === "defer" ? true : void 0,
108
- type: scriptLoading === "module" ? "module" : void 0
108
+ type: scriptLoading === "module" ? "module" : void 0,
109
+ async: scriptLoading === "async" ? true : void 0
109
110
  };
110
111
  const attributes = (0, import_utils.attributesToString)(this.generateAttributes({
111
112
  nonce,
@@ -146,25 +146,22 @@ var ssrPlugin = function() {
146
146
  modifyEntryRuntimePlugins: function modifyEntryRuntimePlugins(param) {
147
147
  var entrypoint = param.entrypoint, plugins = param.plugins, bundlerConfigs = param.bundlerConfigs;
148
148
  if (ssrConfigMap.get(entrypoint.entryName)) {
149
- var _bundlerConfigs_find_output, _bundlerConfigs_find, _config_server, _config_server1;
149
+ var _bundlerConfigs_find_output, _bundlerConfigs_find;
150
150
  var chunkLoadingGlobal = bundlerConfigs === null || bundlerConfigs === void 0 ? void 0 : (_bundlerConfigs_find = bundlerConfigs.find(function(config2) {
151
151
  return config2.name === "client";
152
152
  })) === null || _bundlerConfigs_find === void 0 ? void 0 : (_bundlerConfigs_find_output = _bundlerConfigs_find.output) === null || _bundlerConfigs_find_output === void 0 ? void 0 : _bundlerConfigs_find_output.chunkLoadingGlobal;
153
153
  var config = api.useResolvedConfigContext();
154
154
  var _config_output = config.output, enableInlineScripts = _config_output.enableInlineScripts, enableInlineStyles = _config_output.enableInlineStyles;
155
155
  var _config_html = config.html, crossorigin = _config_html.crossorigin, scriptLoading = _config_html.scriptLoading;
156
- var disablePrerender = typeof ((_config_server = config.server) === null || _config_server === void 0 ? void 0 : _config_server.ssr) === "object" ? Boolean(config.server.ssr.disablePrerender) : false;
157
- var unsafeHeaders = typeof ((_config_server1 = config.server) === null || _config_server1 === void 0 ? void 0 : _config_server1.ssr) === "object" ? config.server.ssr.unsafeHeaders : void 0;
158
156
  plugins.push({
159
157
  name: PLUGIN_IDENTIFIER,
160
- options: JSON.stringify(_object_spread_props(_object_spread({}, ssrConfigMap.get(entrypoint.entryName) || {}), {
158
+ options: JSON.stringify(_object_spread_props(_object_spread({
159
+ scriptLoading
160
+ }, ssrConfigMap.get(entrypoint.entryName) || {}), {
161
161
  crossorigin,
162
- scriptLoading,
163
162
  chunkLoadingGlobal,
164
- disablePrerender,
165
163
  enableInlineScripts: typeof enableInlineScripts === "function" ? void 0 : enableInlineScripts,
166
- enableInlineStyles: typeof enableInlineStyles === "function" ? void 0 : enableInlineStyles,
167
- unsafeHeaders
164
+ enableInlineStyles: typeof enableInlineStyles === "function" ? void 0 : enableInlineStyles
168
165
  }))
169
166
  });
170
167
  }
@@ -164,7 +164,8 @@ var LoadableCollector = /* @__PURE__ */ function() {
164
164
  _config_scriptLoading = config.scriptLoading, scriptLoading = _config_scriptLoading === void 0 ? "defer" : _config_scriptLoading, enableInlineScripts = config.enableInlineScripts;
165
165
  scriptLoadingAtr = {
166
166
  defer: scriptLoading === "defer" ? true : void 0,
167
- type: scriptLoading === "module" ? "module" : void 0
167
+ type: scriptLoading === "module" ? "module" : void 0,
168
+ async: scriptLoading === "async" ? true : void 0
168
169
  };
169
170
  attributes = attributesToString(_this.generateAttributes(_object_spread({
170
171
  nonce
@@ -120,24 +120,20 @@ const ssrPlugin = () => ({
120
120
  },
121
121
  modifyEntryRuntimePlugins({ entrypoint, plugins, bundlerConfigs }) {
122
122
  if (ssrConfigMap.get(entrypoint.entryName)) {
123
- var _bundlerConfigs_find_output, _bundlerConfigs_find, _config_server, _config_server1;
123
+ var _bundlerConfigs_find_output, _bundlerConfigs_find;
124
124
  const chunkLoadingGlobal = bundlerConfigs === null || bundlerConfigs === void 0 ? void 0 : (_bundlerConfigs_find = bundlerConfigs.find((config2) => config2.name === "client")) === null || _bundlerConfigs_find === void 0 ? void 0 : (_bundlerConfigs_find_output = _bundlerConfigs_find.output) === null || _bundlerConfigs_find_output === void 0 ? void 0 : _bundlerConfigs_find_output.chunkLoadingGlobal;
125
125
  const config = api.useResolvedConfigContext();
126
126
  const { enableInlineScripts, enableInlineStyles } = config.output;
127
127
  const { crossorigin, scriptLoading } = config.html;
128
- const disablePrerender = typeof ((_config_server = config.server) === null || _config_server === void 0 ? void 0 : _config_server.ssr) === "object" ? Boolean(config.server.ssr.disablePrerender) : false;
129
- const unsafeHeaders = typeof ((_config_server1 = config.server) === null || _config_server1 === void 0 ? void 0 : _config_server1.ssr) === "object" ? config.server.ssr.unsafeHeaders : void 0;
130
128
  plugins.push({
131
129
  name: PLUGIN_IDENTIFIER,
132
130
  options: JSON.stringify({
131
+ scriptLoading,
133
132
  ...ssrConfigMap.get(entrypoint.entryName) || {},
134
133
  crossorigin,
135
- scriptLoading,
136
134
  chunkLoadingGlobal,
137
- disablePrerender,
138
135
  enableInlineScripts: typeof enableInlineScripts === "function" ? void 0 : enableInlineScripts,
139
- enableInlineStyles: typeof enableInlineStyles === "function" ? void 0 : enableInlineStyles,
140
- unsafeHeaders
136
+ enableInlineStyles: typeof enableInlineStyles === "function" ? void 0 : enableInlineStyles
141
137
  })
142
138
  });
143
139
  }
@@ -72,7 +72,8 @@ class LoadableCollector {
72
72
  const { scriptLoading = "defer", enableInlineScripts } = config;
73
73
  const scriptLoadingAtr = {
74
74
  defer: scriptLoading === "defer" ? true : void 0,
75
- type: scriptLoading === "module" ? "module" : void 0
75
+ type: scriptLoading === "module" ? "module" : void 0,
76
+ async: scriptLoading === "async" ? true : void 0
76
77
  };
77
78
  const attributes = attributesToString(this.generateAttributes({
78
79
  nonce,
@@ -30,7 +30,7 @@ export type ModernSSRReactComponent = React.ComponentType<any>;
30
30
  export { RuntimeContext };
31
31
  export type SSRPluginConfig = {
32
32
  crossorigin?: boolean | 'anonymous' | 'use-credentials';
33
- scriptLoading?: 'defer' | 'blocking' | 'module';
33
+ scriptLoading?: 'defer' | 'blocking' | 'module' | 'async';
34
34
  enableInlineStyles?: boolean | RegExp;
35
35
  enableInlineScripts?: boolean | RegExp;
36
36
  disablePrerender?: boolean;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-nightly-20240101170614",
18
+ "version": "0.0.0-nightly-20240103170618",
19
19
  "engines": {
20
20
  "node": ">=14.17.6"
21
21
  },
@@ -171,10 +171,10 @@
171
171
  "react-side-effect": "^2.1.1",
172
172
  "styled-components": "^5.3.1",
173
173
  "@swc/helpers": "0.5.3",
174
- "@modern-js/plugin": "0.0.0-nightly-20240101170614",
175
- "@modern-js/types": "0.0.0-nightly-20240101170614",
176
- "@modern-js/utils": "0.0.0-nightly-20240101170614",
177
- "@modern-js/runtime-utils": "0.0.0-nightly-20240101170614"
174
+ "@modern-js/plugin": "0.0.0-nightly-20240103170618",
175
+ "@modern-js/utils": "0.0.0-nightly-20240103170618",
176
+ "@modern-js/types": "0.0.0-nightly-20240103170618",
177
+ "@modern-js/runtime-utils": "0.0.0-nightly-20240103170618"
178
178
  },
179
179
  "peerDependencies": {
180
180
  "react": ">=17",
@@ -195,11 +195,11 @@
195
195
  "ts-jest": "^29.1.0",
196
196
  "typescript": "^5",
197
197
  "webpack": "^5.89.0",
198
- "@modern-js/core": "0.0.0-nightly-20240101170614",
199
- "@modern-js/app-tools": "0.0.0-nightly-20240101170614",
200
- "@scripts/build": "0.0.0-nightly-20240101170614",
201
- "@modern-js/server-core": "0.0.0-nightly-20240101170614",
202
- "@scripts/jest-config": "0.0.0-nightly-20240101170614"
198
+ "@modern-js/core": "0.0.0-nightly-20240103170618",
199
+ "@modern-js/app-tools": "0.0.0-nightly-20240103170618",
200
+ "@modern-js/server-core": "0.0.0-nightly-20240103170618",
201
+ "@scripts/build": "0.0.0-nightly-20240103170618",
202
+ "@scripts/jest-config": "0.0.0-nightly-20240103170618"
203
203
  },
204
204
  "sideEffects": false,
205
205
  "publishConfig": {