Skip to content

Commit

Permalink
misc refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Feb 27, 2024
1 parent 2cda045 commit 25480b3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/cli/src/lib/execute-route-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ async function executeRouteModule({ moduleUrl, compilation, page = {}, prerender
}

// TODO cant we get these from just pulling from the file during the graph phase?
// https://github.com/ProjectEvergreen/greenwood/issues/991
data.prerender = prerender;
data.isolation = isolation;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/lifecycles/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ const generateGraph = async (compilation) => {

const relativeApiPath = filenameUrl.pathname.replace(userWorkspace.pathname, '/');
const route = `${basePath}${relativeApiPath.replace(`.${extension}`, '')}`;
// TODO should this be run in isolation like SSR pages?
// https://github.com/ProjectEvergreen/greenwood/issues/991
const { isolation } = await import(filenameUrl).then(module => module);

/*
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lifecycles/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ async function getHybridServer(compilation) {
console.log('run SSR page in isolation mode!', { matchingRoute });

await new Promise(async (resolve, reject) => {
const worker = new Worker(new URL('../lib/ssr-route-worker-prod.js', import.meta.url));
const worker = new Worker(new URL('../lib/ssr-route-worker-isolation-mode.js', import.meta.url));
// TODO "faux" new Request here, a better way?
const request = await requestAsObject(new Request(url));

Expand Down
1 change: 1 addition & 0 deletions packages/plugin-renderer-lit/src/execute-route-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ async function executeRouteModule({ moduleUrl, compilation, page, prerender, htm
const { getTemplate = null, getBody = null, getFrontmatter = null, isolation } = module;

// TODO cant we get these from just pulling from the file during the graph phase?
// https://github.com/ProjectEvergreen/greenwood/issues/991
if (isolation) {
data.isolation = true;
}
Expand Down

0 comments on commit 25480b3

Please sign in to comment.