Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 09d46b2

Browse files
committed
Clean up
1 parent e7f79d4 commit 09d46b2

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

framework/core/redirect.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import events from "./events.ts";
44
let routerReady = false;
55
let preRedirect: URL | null = null;
66

7-
const deno = typeof Deno === "object" && Deno !== null && typeof Deno.env === "object";
8-
97
const onrouterready = (_: Record<string, unknown>) => {
108
events.off("routerready", onrouterready);
119
if (preRedirect) {
@@ -17,12 +15,11 @@ const onrouterready = (_: Record<string, unknown>) => {
1715
events.on("routerready", onrouterready);
1816

1917
export function redirect(url: string, replace?: boolean) {
20-
if (!util.isFilledString(url) || deno) {
18+
const { history, location } = globalThis;
19+
if (!util.isFilledString(url) || !history || !location) {
2120
return;
2221
}
2322

24-
const { location } = window;
25-
2623
if (util.isLikelyHttpURL(url) || url.startsWith("file://") || url.startsWith("mailto:") || url.startsWith("data:")) {
2724
location.href = url;
2825
return;

loaders/vue.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from "https://esm.sh/@vue/[email protected]";
1414
import log from "../lib/log.ts";
1515
import util from "../lib/util.ts";
16-
import type { ModuleLoader, ModuleLoaderContent, ModuleLoaderEnv } from "../server/types.ts";
16+
import type { ModuleLoader, ModuleLoaderEnv, ModuleLoaderOutput } from "../server/types.ts";
1717

1818
type Options = {
1919
script?: Omit<SFCScriptCompileOptions, "id">;
@@ -28,7 +28,7 @@ export default class VueSFCLoader implements Pick<ModuleLoader, "load"> {
2828
this.#options = { ...options };
2929
}
3030

31-
async load(pathname: string, env: ModuleLoaderEnv): Promise<ModuleLoaderContent> {
31+
async load(pathname: string, env: ModuleLoaderEnv): Promise<ModuleLoaderOutput> {
3232
const content = await Deno.readTextFile(`.${pathname}`);
3333
const filename = "." + pathname;
3434
const id = (await util.computeHash("SHA-256", filename)).slice(0, 8);
@@ -134,7 +134,7 @@ export default class VueSFCLoader implements Pick<ModuleLoader, "load"> {
134134
code: output.join("\n"),
135135
lang: isTS ? "ts" : "js",
136136
inlineCSS: css || undefined,
137-
atomicCSS: true,
137+
isTemplateLanguage: true,
138138
};
139139
}
140140
}

server/build.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,7 @@ export async function build(serverEntry?: string) {
245245

246246
// create server_dependency_graph.js
247247
if (serverDependencyGraph) {
248-
// deno-lint-ignore no-unused-vars
249-
const modules = serverDependencyGraph.modules.map(({ sourceCode, ...ret }) => ret);
248+
const { modules } = serverDependencyGraph;
250249
await Deno.writeTextFile(
251250
join(outputDir, "server_dependency_graph.js"),
252251
"export default " + JSON.stringify({ modules }),

server/transformer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ import {
1616
} from "./helpers.ts";
1717
import { isRouteFile } from "./routing.ts";
1818
import { DependencyGraph } from "./graph.ts";
19-
import type { ImportMap, JSXConfig, ModuleLoaderContent } from "./types.ts";
19+
import type { ImportMap, JSXConfig, ModuleLoaderOutput } from "./types.ts";
2020

2121
export type TransformerOptions = {
2222
buildTarget?: TransformOptions["target"];
2323
importMap: ImportMap;
2424
isDev: boolean;
2525
jsxConfig?: JSXConfig;
26-
loaded?: ModuleLoaderContent;
26+
loaded?: ModuleLoaderOutput;
2727
};
2828

2929
export default {
@@ -46,7 +46,7 @@ export default {
4646
sourceCode = loaded.code;
4747
lang = loaded.lang;
4848
isCSS = loaded.lang === "css";
49-
uno = !!loaded.atomicCSS;
49+
uno = Boolean(loaded.isTemplateLanguage || loaded.lang === "jsx" || loaded.lang === "tsx");
5050
} else {
5151
let codeType: string;
5252
[sourceCode, codeType] = await readCode(specifier);

0 commit comments

Comments
 (0)