@modern-js/server 2.43.0 → 2.45.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.
@@ -34,7 +34,7 @@ function createSocketUrl(resourceQuery) {
34
34
  return getSocketUrl(options, currentLocation);
35
35
  }
36
36
  function formatURL({ port, protocol, hostname, pathname }) {
37
- if (window.URL) {
37
+ if (typeof URL !== "undefined") {
38
38
  const url = new URL("http://localhost");
39
39
  url.port = port;
40
40
  url.hostname = hostname;
@@ -36,7 +36,7 @@ var import_utils = require("@modern-js/utils");
36
36
  const PORT = 9230;
37
37
  async function workerSSRRender(ctx, renderOptions, _runner) {
38
38
  const { headers, params } = ctx;
39
- const { urlPath } = renderOptions;
39
+ const { urlPath } = renderOptions.route;
40
40
  const url = `http://0.0.0.0:${PORT}/${urlPath}`;
41
41
  const resposne = await import_axios.default.get(url, {
42
42
  timeout: 5e3,
@@ -28,7 +28,7 @@ function createSocketUrl(resourceQuery) {
28
28
  }
29
29
  function formatURL(param) {
30
30
  var port = param.port, protocol = param.protocol, hostname = param.hostname, pathname = param.pathname;
31
- if (window.URL) {
31
+ if (typeof URL !== "undefined") {
32
32
  var url = new URL("http://localhost");
33
33
  url.port = port;
34
34
  url.hostname = hostname;
@@ -13,7 +13,7 @@ function _workerSSRRender() {
13
13
  switch (_state.label) {
14
14
  case 0:
15
15
  headers = ctx.headers, params = ctx.params;
16
- urlPath = renderOptions.urlPath;
16
+ urlPath = renderOptions.route.urlPath;
17
17
  url = "http://0.0.0.0:".concat(PORT, "/").concat(urlPath);
18
18
  return [
19
19
  4,
@@ -10,7 +10,7 @@ function createSocketUrl(resourceQuery) {
10
10
  return getSocketUrl(options, currentLocation);
11
11
  }
12
12
  function formatURL({ port, protocol, hostname, pathname }) {
13
- if (window.URL) {
13
+ if (typeof URL !== "undefined") {
14
14
  const url = new URL("http://localhost");
15
15
  url.port = port;
16
16
  url.hostname = hostname;
@@ -3,7 +3,7 @@ import { mime } from "@modern-js/utils";
3
3
  const PORT = 9230;
4
4
  async function workerSSRRender(ctx, renderOptions, _runner) {
5
5
  const { headers, params } = ctx;
6
- const { urlPath } = renderOptions;
6
+ const { urlPath } = renderOptions.route;
7
7
  const url = `http://0.0.0.0:${PORT}/${urlPath}`;
8
8
  const resposne = await axios.get(url, {
9
9
  timeout: 5e3,
@@ -1,7 +1,8 @@
1
1
  import { ServerHookRunner } from '@modern-js/prod-server';
2
2
  import { ModernServerContext } from '@modern-js/types/server';
3
+ import { ModernRoute } from '@modern-js/prod-server/src/libs/route';
3
4
  export declare function workerSSRRender(ctx: ModernServerContext, renderOptions: {
4
- urlPath: string;
5
+ route: ModernRoute;
5
6
  [props: string]: any;
6
7
  }, _runner: ServerHookRunner): Promise<{
7
8
  content: any;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.43.0",
18
+ "version": "2.45.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -48,14 +48,14 @@
48
48
  "path-to-regexp": "^6.2.0",
49
49
  "ws": "^8.13.0",
50
50
  "axios": "^1.6.0",
51
- "@modern-js/prod-server": "2.43.0",
52
- "@modern-js/server-utils": "2.43.0",
53
- "@modern-js/types": "2.43.0",
54
- "@modern-js/utils": "2.43.0",
55
- "@modern-js/runtime-utils": "2.43.0"
51
+ "@modern-js/prod-server": "2.45.0",
52
+ "@modern-js/types": "2.45.0",
53
+ "@modern-js/utils": "2.45.0",
54
+ "@modern-js/server-utils": "2.45.0",
55
+ "@modern-js/runtime-utils": "2.45.0"
56
56
  },
57
57
  "devDependencies": {
58
- "@rsbuild/shared": "0.2.7",
58
+ "@rsbuild/shared": "0.2.15",
59
59
  "@types/connect-history-api-fallback": "^1.3.5",
60
60
  "@types/jest": "^29",
61
61
  "@types/minimatch": "^3.0.5",
@@ -68,9 +68,9 @@
68
68
  "typescript": "^5",
69
69
  "webpack": "^5.89.0",
70
70
  "websocket": "^1",
71
- "@modern-js/server-core": "2.43.0",
72
- "@scripts/build": "2.43.0",
73
- "@scripts/jest-config": "2.43.0"
71
+ "@scripts/build": "2.45.0",
72
+ "@modern-js/server-core": "2.45.0",
73
+ "@scripts/jest-config": "2.45.0"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "devcert": "^1.0.0",