@jay-framework/dev-server 0.15.1 → 0.15.2

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.
Files changed (2) hide show
  1. package/dist/index.js +22 -11
  2. package/package.json +14 -14
package/dist/index.js CHANGED
@@ -1152,8 +1152,8 @@ function extractPackageName(source) {
1152
1152
  function isSubpathImport(source, packageName) {
1153
1153
  return source.length > packageName.length && source[packageName.length] === "/";
1154
1154
  }
1155
- const IMPORT_REGEX = /import\s+(.+?)\s+from\s+(['"])([^'"]+)\2/g;
1156
- const EXPORT_FROM_REGEX = /export\s+(.+?)\s+from\s+(['"])([^'"]+)\2/g;
1155
+ const IMPORT_REGEX = /import\s+([\s\S]+?)\s+from\s+(['"])([^'"]+)\2/g;
1156
+ const EXPORT_FROM_REGEX = /export\s+([\s\S]+?)\s+from\s+(['"])([^'"]+)\2/g;
1157
1157
  function transformImports(options) {
1158
1158
  const { code, projectRoot, filePath, pluginDetector, verbose = false } = options;
1159
1159
  let hasChanges = false;
@@ -1908,6 +1908,11 @@ function mkRoute(route, vite, slowlyPhase, options, slowRenderCache, projectInit
1908
1908
  language: "en",
1909
1909
  url
1910
1910
  };
1911
+ const query = {};
1912
+ const urlObj = new URL(req.originalUrl, `http://${req.headers.host}`);
1913
+ for (const [key, value] of urlObj.searchParams) {
1914
+ query[key] = value;
1915
+ }
1911
1916
  if (options.disableSSR) {
1912
1917
  await handleClientOnlyRequest(
1913
1918
  vite,
@@ -1921,7 +1926,8 @@ function mkRoute(route, vite, slowlyPhase, options, slowRenderCache, projectInit
1921
1926
  projectInit,
1922
1927
  res,
1923
1928
  url,
1924
- timing
1929
+ timing,
1930
+ query
1925
1931
  );
1926
1932
  } else {
1927
1933
  const cachedEntry = await slowRenderCache.get(route.jayHtmlPath, pageParams);
@@ -1938,7 +1944,8 @@ function mkRoute(route, vite, slowlyPhase, options, slowRenderCache, projectInit
1938
1944
  projectInit,
1939
1945
  res,
1940
1946
  url,
1941
- timing
1947
+ timing,
1948
+ query
1942
1949
  );
1943
1950
  } else {
1944
1951
  await handlePreRenderRequest(
@@ -1954,7 +1961,8 @@ function mkRoute(route, vite, slowlyPhase, options, slowRenderCache, projectInit
1954
1961
  projectInit,
1955
1962
  res,
1956
1963
  url,
1957
- timing
1964
+ timing,
1965
+ query
1958
1966
  );
1959
1967
  }
1960
1968
  }
@@ -1967,7 +1975,7 @@ function mkRoute(route, vite, slowlyPhase, options, slowRenderCache, projectInit
1967
1975
  };
1968
1976
  return { path: routePath, handler, fsRoute: route };
1969
1977
  }
1970
- async function handleCachedRequest(vite, route, options, cachedEntry, pageParams, pageProps, allPluginClientInits, allPluginsWithInit, projectInit, res, url, timing) {
1978
+ async function handleCachedRequest(vite, route, options, cachedEntry, pageParams, pageProps, allPluginClientInits, allPluginsWithInit, projectInit, res, url, timing, query = {}) {
1971
1979
  const loadStart = Date.now();
1972
1980
  const pagePartsResult = await loadPageParts(
1973
1981
  vite,
@@ -2005,7 +2013,8 @@ async function handleCachedRequest(vite, route, options, cachedEntry, pageParams
2005
2013
  instancePhaseData,
2006
2014
  forEachInstances,
2007
2015
  headlessComps,
2008
- cachedEntry.slowViewState
2016
+ cachedEntry.slowViewState,
2017
+ query
2009
2018
  );
2010
2019
  timing?.recordFastRender(Date.now() - fastStart);
2011
2020
  if (renderedFast.kind !== "PhaseOutput") {
@@ -2033,7 +2042,7 @@ async function handleCachedRequest(vite, route, options, cachedEntry, pageParams
2033
2042
  cachedEntry.preRenderedContent
2034
2043
  );
2035
2044
  }
2036
- async function handlePreRenderRequest(vite, route, options, slowlyPhase, slowRenderCache, pageParams, pageProps, allPluginClientInits, allPluginsWithInit, projectInit, res, url, timing) {
2045
+ async function handlePreRenderRequest(vite, route, options, slowlyPhase, slowRenderCache, pageParams, pageProps, allPluginClientInits, allPluginsWithInit, projectInit, res, url, timing, query = {}) {
2037
2046
  const loadStart = Date.now();
2038
2047
  const initialPartsResult = await loadPageParts(
2039
2048
  vite,
@@ -2112,10 +2121,11 @@ async function handlePreRenderRequest(vite, route, options, slowlyPhase, slowRen
2112
2121
  projectInit,
2113
2122
  res,
2114
2123
  url,
2115
- timing
2124
+ timing,
2125
+ query
2116
2126
  );
2117
2127
  }
2118
- async function handleClientOnlyRequest(vite, route, options, slowlyPhase, pageParams, pageProps, allPluginClientInits, allPluginsWithInit, projectInit, res, url, timing) {
2128
+ async function handleClientOnlyRequest(vite, route, options, slowlyPhase, pageParams, pageProps, allPluginClientInits, allPluginsWithInit, projectInit, res, url, timing, query = {}) {
2119
2129
  const loadStart = Date.now();
2120
2130
  const pagePartsResult = await loadPageParts(
2121
2131
  vite,
@@ -2173,7 +2183,8 @@ async function handleClientOnlyRequest(vite, route, options, slowlyPhase, pagePa
2173
2183
  instancePhaseData,
2174
2184
  forEachInstances,
2175
2185
  headlessInstanceComponents,
2176
- renderedSlowly.rendered
2186
+ renderedSlowly.rendered,
2187
+ query
2177
2188
  );
2178
2189
  timing?.recordFastRender(Date.now() - fastStart);
2179
2190
  if (renderedFast.kind !== "PhaseOutput") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jay-framework/dev-server",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -23,22 +23,22 @@
23
23
  "test:watch": "vitest"
24
24
  },
25
25
  "dependencies": {
26
- "@jay-framework/compiler-jay-stack": "^0.15.1",
27
- "@jay-framework/compiler-shared": "^0.15.1",
28
- "@jay-framework/component": "^0.15.1",
29
- "@jay-framework/fullstack-component": "^0.15.1",
30
- "@jay-framework/logger": "^0.15.1",
31
- "@jay-framework/runtime": "^0.15.1",
32
- "@jay-framework/stack-client-runtime": "^0.15.1",
33
- "@jay-framework/stack-route-scanner": "^0.15.1",
34
- "@jay-framework/stack-server-runtime": "^0.15.1",
35
- "@jay-framework/view-state-merge": "^0.15.1",
26
+ "@jay-framework/compiler-jay-stack": "^0.15.2",
27
+ "@jay-framework/compiler-shared": "^0.15.2",
28
+ "@jay-framework/component": "^0.15.2",
29
+ "@jay-framework/fullstack-component": "^0.15.2",
30
+ "@jay-framework/logger": "^0.15.2",
31
+ "@jay-framework/runtime": "^0.15.2",
32
+ "@jay-framework/stack-client-runtime": "^0.15.2",
33
+ "@jay-framework/stack-route-scanner": "^0.15.2",
34
+ "@jay-framework/stack-server-runtime": "^0.15.2",
35
+ "@jay-framework/view-state-merge": "^0.15.2",
36
36
  "vite": "^5.0.11"
37
37
  },
38
38
  "devDependencies": {
39
- "@jay-framework/dev-environment": "^0.15.1",
40
- "@jay-framework/jay-cli": "^0.15.1",
41
- "@jay-framework/stack-client-runtime": "^0.15.1",
39
+ "@jay-framework/dev-environment": "^0.15.2",
40
+ "@jay-framework/jay-cli": "^0.15.2",
41
+ "@jay-framework/stack-client-runtime": "^0.15.2",
42
42
  "@playwright/test": "^1.58.2",
43
43
  "@types/express": "^5.0.2",
44
44
  "@types/node": "^22.15.21",