chore: version preact explicitly in import map (#258)
This allows users to control the `preact` version independently of fresh itself.
This commit is contained in:
+2
-1
@@ -1,4 +1,5 @@
|
||||
import { createContext, useContext } from "./deps.ts";
|
||||
import { createContext } from "preact";
|
||||
import { useContext } from "preact/hooks";
|
||||
|
||||
export const SELF = "'self'";
|
||||
export const UNSAFE_INLINE = "'unsafe-inline'";
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
export * from "https://esm.sh/preact@10.6.6";
|
||||
export { jsx, jsxDEV, jsxs } from "https://esm.sh/preact@10.6.6/jsx-runtime";
|
||||
export {
|
||||
useCallback,
|
||||
useContext,
|
||||
useDebugValue,
|
||||
useEffect,
|
||||
useErrorBoundary,
|
||||
useImperativeHandle,
|
||||
useLayoutEffect,
|
||||
useMemo,
|
||||
useReducer,
|
||||
useRef,
|
||||
useState,
|
||||
} from "https://esm.sh/preact@10.6.6/hooks";
|
||||
export type {
|
||||
CreateHandle,
|
||||
EffectCallback,
|
||||
Inputs,
|
||||
PropRef,
|
||||
Reducer,
|
||||
Ref,
|
||||
StateUpdater,
|
||||
} from "https://esm.sh/preact@10.6.6/hooks";
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
import { ComponentChildren, createContext, useContext } from "./deps.ts";
|
||||
import { ComponentChildren, createContext } from "preact";
|
||||
import { useContext } from "preact/hooks";
|
||||
|
||||
export interface HeadProps {
|
||||
children: ComponentChildren;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { ComponentType, h, options, render } from "./deps.ts";
|
||||
import { ComponentType, h, options, render } from "preact";
|
||||
import { assetHashingHook } from "./utils.ts";
|
||||
|
||||
function createRootFragment(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ComponentType } from "./deps.ts";
|
||||
import { ComponentType } from "preact";
|
||||
|
||||
// deno-lint-ignore no-explicit-any
|
||||
export interface PageProps<T = any> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { VNode } from "./deps.ts";
|
||||
import { VNode } from "preact";
|
||||
|
||||
export const INTERNAL_PREFIX = "/_frsh";
|
||||
export const ASSET_CACHE_BUST_KEY = "__frsh_c";
|
||||
|
||||
@@ -8,10 +8,10 @@ import {
|
||||
toFileUrl,
|
||||
walk,
|
||||
} from "./deps.ts";
|
||||
import { h } from "preact";
|
||||
import { Manifest } from "./mod.ts";
|
||||
import { Bundler } from "./bundle.ts";
|
||||
import { ALIVE_URL, BUILD_ID, JS_PREFIX, REFRESH_JS_URL } from "./constants.ts";
|
||||
|
||||
import DefaultErrorHandler from "./default_error_page.tsx";
|
||||
import {
|
||||
AppModule,
|
||||
@@ -32,7 +32,6 @@ import {
|
||||
} from "./types.ts";
|
||||
import { render as internalRender } from "./render.tsx";
|
||||
import { ContentSecurityPolicyDirectives, SELF } from "../runtime/csp.ts";
|
||||
import { h } from "../runtime/deps.ts";
|
||||
import { ASSET_CACHE_BUST_KEY, INTERNAL_PREFIX } from "../runtime/utils.ts";
|
||||
|
||||
interface StaticFile {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @jsx h */
|
||||
|
||||
import { h } from "../runtime/deps.ts";
|
||||
import { h } from "preact";
|
||||
import { DEBUG } from "./constants.ts";
|
||||
import type { ErrorPageProps } from "../runtime/types.ts";
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
// -- preact --
|
||||
export { renderToString } from "https://esm.sh/preact-render-to-string@5.1.20?deps=preact@10.6.6";
|
||||
|
||||
// -- std --
|
||||
export {
|
||||
extname,
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
/** @jsx h */
|
||||
import { renderToString } from "./deps.ts";
|
||||
import {
|
||||
ComponentChildren,
|
||||
ComponentType,
|
||||
h,
|
||||
options,
|
||||
} from "../runtime/deps.ts";
|
||||
import { renderToString } from "preact-render-to-string";
|
||||
import { ComponentChildren, ComponentType, h, options } from "preact";
|
||||
import {
|
||||
AppModule,
|
||||
ErrorPage,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { ComponentType } from "../runtime/deps.ts";
|
||||
import { ComponentType } from "preact";
|
||||
import { ConnInfo, router, ServeInit } from "./deps.ts";
|
||||
import {
|
||||
AppProps,
|
||||
|
||||
Reference in New Issue
Block a user