@cedarjs/prerender 6.0.0-canary.2780 → 6.0.0-canary.2782

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.
@@ -1 +1 @@
1
- {"version":3,"file":"runPrerender.d.ts","sourceRoot":"","sources":["../../src/runPrerender.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAwO7C,UAAU,eAAe;IACvB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACrC,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,YAAY,GAAU,6BAGhC,eAAe,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAkIzC,CAAA;AAGD,eAAO,MAAM,wBAAwB,GACnC,gBAAgB,MAAM,EACtB,SAAS,MAAM,SAchB,CAAA"}
1
+ {"version":3,"file":"runPrerender.d.ts","sourceRoot":"","sources":["../../src/runPrerender.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AA4O7C,UAAU,eAAe;IACvB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACrC,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,YAAY,GAAU,6BAGhC,eAAe,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAkIzC,CAAA;AAGD,eAAO,MAAM,wBAAwB,GACnC,gBAAgB,MAAM,EACtB,SAAS,MAAM,SAchB,CAAA"}
@@ -40,8 +40,6 @@ var import_cheerio = require("cheerio");
40
40
  var import_server = __toESM(require("react-dom/server"), 1);
41
41
  var import_babel_config = require("@cedarjs/babel-config");
42
42
  var import_project_config = require("@cedarjs/project-config");
43
- var import_router = require("@cedarjs/router");
44
- var import_util = require("@cedarjs/router/dist/util");
45
43
  var import_babel_plugin_redwood_cell = require("./babelPlugins/babel-plugin-redwood-cell.js");
46
44
  var import_babel_plugin_redwood_prerender_media_imports = require("./babelPlugins/babel-plugin-redwood-prerender-media-imports.js");
47
45
  var import_detection = require("./detection/detection.js");
@@ -54,6 +52,7 @@ const prerenderApolloClient = new import_client.ApolloClient({
54
52
  });
55
53
  async function recursivelyRender(App, Routes, renderPath, fileImporter, gqlHandler, queryCache) {
56
54
  const { CellCacheContextProvider, getOperationName } = require("@cedarjs/web");
55
+ const { LocationProvider } = require("@cedarjs/router");
57
56
  let shouldShowGraphqlHandlerNotFoundWarn = false;
58
57
  await Promise.all(
59
58
  Object.entries(queryCache).map(async ([cacheKey, value]) => {
@@ -116,7 +115,7 @@ async function recursivelyRender(App, Routes, renderPath, fileImporter, gqlHandl
116
115
  );
117
116
  const prerenderUrl = process.env.RWJS_PRERENDER_ORIGIN || "http://localhost" + renderPath;
118
117
  const componentAsHtml = import_server.default.renderToString(
119
- /* @__PURE__ */ import_react.default.createElement(import_router.LocationProvider, { location: new URL(prerenderUrl) }, /* @__PURE__ */ import_react.default.createElement(CellCacheContextProvider, { queryCache }, /* @__PURE__ */ import_react.default.createElement(App, null, /* @__PURE__ */ import_react.default.createElement(Routes, null))))
118
+ /* @__PURE__ */ import_react.default.createElement(LocationProvider, { location: new URL(prerenderUrl) }, /* @__PURE__ */ import_react.default.createElement(CellCacheContextProvider, { queryCache }, /* @__PURE__ */ import_react.default.createElement(App, null, /* @__PURE__ */ import_react.default.createElement(Routes, null))))
120
119
  );
121
120
  if (Object.values(queryCache).some((value) => !value.hasProcessed)) {
122
121
  return recursivelyRender(
@@ -137,12 +136,13 @@ async function recursivelyRender(App, Routes, renderPath, fileImporter, gqlHandl
137
136
  }
138
137
  }
139
138
  function insertChunkLoadingScript(indexHtmlTree, renderPath) {
139
+ const { matchPath } = require("@cedarjs/router/dist/util");
140
140
  const prerenderRoutes = (0, import_detection.detectPrerenderRoutes)();
141
141
  const route = prerenderRoutes.find((route2) => {
142
142
  if (!route2.routePath) {
143
143
  return false;
144
144
  }
145
- return (0, import_util.matchPath)(route2.routePath, renderPath).match;
145
+ return matchPath(route2.routePath, renderPath).match;
146
146
  });
147
147
  if (!route) {
148
148
  throw new Error("Could not find a Route matching " + renderPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/prerender",
3
- "version": "6.0.0-canary.2780",
3
+ "version": "6.0.0-canary.2782",
4
4
  "description": "CedarJS prerender",
5
5
  "repository": {
6
6
  "type": "git",
@@ -71,10 +71,10 @@
71
71
  "@babel/generator": "7.29.7",
72
72
  "@babel/parser": "7.29.7",
73
73
  "@babel/traverse": "7.29.7",
74
- "@cedarjs/babel-config": "6.0.0-canary.2780",
75
- "@cedarjs/project-config": "6.0.0-canary.2780",
76
- "@cedarjs/structure": "6.0.0-canary.2780",
77
- "@cedarjs/vite": "6.0.0-canary.2780",
74
+ "@cedarjs/babel-config": "6.0.0-canary.2782",
75
+ "@cedarjs/project-config": "6.0.0-canary.2782",
76
+ "@cedarjs/structure": "6.0.0-canary.2782",
77
+ "@cedarjs/vite": "6.0.0-canary.2782",
78
78
  "@rollup/plugin-alias": "5.1.1",
79
79
  "@rollup/plugin-commonjs": "28.0.9",
80
80
  "@rollup/plugin-node-resolve": "16.0.3",
@@ -92,9 +92,9 @@
92
92
  "vite": "7.3.6"
93
93
  },
94
94
  "devDependencies": {
95
- "@cedarjs/framework-tools": "6.0.0-canary.2780",
96
- "@cedarjs/router": "6.0.0-canary.2780",
97
- "@cedarjs/web": "6.0.0-canary.2780",
95
+ "@cedarjs/framework-tools": "6.0.0-canary.2782",
96
+ "@cedarjs/router": "6.0.0-canary.2782",
97
+ "@cedarjs/web": "6.0.0-canary.2782",
98
98
  "@types/mime-types": "2.1.4",
99
99
  "@types/react": "^18.2.55",
100
100
  "babel-plugin-tester": "11.0.4",
@@ -104,8 +104,8 @@
104
104
  "vitest": "4.1.10"
105
105
  },
106
106
  "peerDependencies": {
107
- "@cedarjs/router": "6.0.0-canary.2780",
108
- "@cedarjs/web": "6.0.0-canary.2780",
107
+ "@cedarjs/router": "6.0.0-canary.2782",
108
+ "@cedarjs/web": "6.0.0-canary.2782",
109
109
  "react": "19.2.3",
110
110
  "react-dom": "19.2.3"
111
111
  },