diff --git a/deno.json b/deno.json index accac1393..c10473659 100644 --- a/deno.json +++ b/deno.json @@ -10,7 +10,7 @@ "./types.d.ts" ], "jsx": "react-jsx", - "jsxImportSource": "https://esm.sh/react@18.2.0" + "jsxImportSource": "https://esm.sh/v112/react@18.2.0" }, "importMap": "./import_map.json", "fmt": { diff --git a/import_map.json b/import_map.json index 31ec9ab11..204dcc11b 100644 --- a/import_map.json +++ b/import_map.json @@ -15,13 +15,13 @@ "aleph/plugins/solid": "./framework/solid/plugin.ts", "@unocss/core": "https://esm.sh/v112/@unocss/core@0.50.6", "@unocss/preset-uno": "https://esm.sh/v112/@unocss/preset-uno@0.50.6", - "react": "https://esm.sh/react@18.2.0", + "react": "https://esm.sh/v112/react@18.2.0", "react-dom": "https://esm.sh/v112/react-dom@18.2.0", "react-dom/": "https://esm.sh/v112/react-dom@18.2.0/", "@mdx-js/react": "https://esm.sh/v112/@mdx-js/react@2.3.0", - "vue": "https://esm.sh/vue@3.2.39", + "vue": "https://esm.sh/v112/vue@3.2.39", "@vue/server-renderer": "https://esm.sh/v112/@vue/server-renderer@3.2.39", - "solid-js": "https://esm.sh/solid-js@1.6.12", + "solid-js": "https://esm.sh/v112/solid-js@1.6.12", "solid-js/web": "https://esm.sh/solid-js@1.6.12/web", "solid-refresh": "https://esm.sh/v112/solid-refresh@0.5.1&deps=solid-js@1.6.12" } diff --git a/init.ts b/init.ts index c730a4c0b..9135b6a26 100644 --- a/init.ts +++ b/init.ts @@ -213,7 +213,7 @@ export default async function init(nameArg?: string, options?: Options) { Object.assign(importMap.imports, { "aleph/react": `${alephPkgUri}/framework/react/mod.ts`, "aleph/plugins/react": `${alephPkgUri}/framework/react/plugin.ts`, - "react": `https://esm.sh/react@${versions.react}`, + "react": `https://esm.sh/v${ESM_VERSION}/react@${versions.react}`, "react-dom": `https://esm.sh/v${ESM_VERSION}/react-dom@${versions.react}`, "react-dom/": `https://esm.sh/v${ESM_VERSION}/react-dom@${versions.react}/`, }); @@ -223,7 +223,7 @@ export default async function init(nameArg?: string, options?: Options) { Object.assign(importMap.imports, { "aleph/vue": `${alephPkgUri}/framework/vue/mod.ts`, "aleph/plugins/vue": `${alephPkgUri}/framework/vue/plugin.ts`, - "vue": `https://esm.sh/vue@${versions.vue}`, + "vue": `https://esm.sh/v${ESM_VERSION}/vue@${versions.vue}`, "@vue/server-renderer": `https://esm.sh/v${ESM_VERSION}/@vue/server-renderer@${versions.vue}`, }); break; diff --git a/plugins/mdx.ts b/plugins/mdx.ts index 6948ceff1..3f17ec054 100644 --- a/plugins/mdx.ts +++ b/plugins/mdx.ts @@ -17,8 +17,7 @@ export class MDXLoader implements ModuleLoader { const ret = await compile( { path: specifier, value: content }, { - jsxImportSource: this.#options.jsxImportSource ?? env.jsxConfig?.jsxImportSource ?? - "https://esm.sh/react@18.2.0", + jsxImportSource: this.#options.jsxImportSource ?? env.jsxConfig?.jsxImportSource, ...this.#options, providerImportSource: this.#options.providerImportSource ? env.importMap?.imports[this.#options.providerImportSource] ?? this.#options.providerImportSource diff --git a/server/helpers.ts b/server/helpers.ts index 1f652d97a..fa36d5638 100644 --- a/server/helpers.ts +++ b/server/helpers.ts @@ -162,7 +162,7 @@ export function toResponse(v: unknown, init?: ResponseInit): Response { /** * Fix remote url to local path. - * e.g. `https://esm.sh/react@17.0.2?dev` -> `/-/esm.sh/react@17.0.2?dev` + * e.g. `https://esm.sh/react@18.2.0?dev` -> `/-/esm.sh/react@18.2.0?dev` */ export function toLocalPath(url: string): string { if (isLikelyHttpURL(url)) { @@ -185,7 +185,7 @@ export function toLocalPath(url: string): string { /** * Restore the remote url from local path. - * e.g. `/-/esm.sh/react@17.0.2` -> `https://esm.sh/v112/react@17.0.2` + * e.g. `/-/esm.sh/react@18.2.0` -> `https://esm.sh/v112/react@18.2.0` */ export function restoreUrl(pathname: string): string { let [h, ...rest] = pathname.substring(3).split("/");