-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df453e4
commit d361a3e
Showing
16 changed files
with
104 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import type { ViteDevServer } from 'vite'; | ||
import { isPage, resolveIdToUrl } from '../../util.js'; | ||
import { resolveIdToUrl } from '../../util.js'; | ||
|
||
export function createResolve(viteServer: ViteDevServer) { | ||
// Resolves specifiers in the inline hydrated scripts, such as: | ||
// - @astrojs/preact/client.js | ||
// - @/components/Foo.vue | ||
// - /Users/macos/project/src/Foo.vue | ||
// - C:/Windows/project/src/Foo.vue (normalized slash) | ||
return async function(s: string) { | ||
const url = await resolveIdToUrl(viteServer, s); | ||
// Vite does not resolve .jsx -> .tsx when coming from hydration script import, | ||
// clip it so Vite is able to resolve implicitly. | ||
if (url.startsWith('/@fs') && url.endsWith('.jsx')) { | ||
return url.slice(0, -4); | ||
} else { | ||
return url; | ||
} | ||
}; | ||
// Resolves specifiers in the inline hydrated scripts, such as: | ||
// - @astrojs/preact/client.js | ||
// - @/components/Foo.vue | ||
// - /Users/macos/project/src/Foo.vue | ||
// - C:/Windows/project/src/Foo.vue (normalized slash) | ||
return async function (s: string) { | ||
const url = await resolveIdToUrl(viteServer, s); | ||
// Vite does not resolve .jsx -> .tsx when coming from hydration script import, | ||
// clip it so Vite is able to resolve implicitly. | ||
if (url.startsWith('/@fs') && url.endsWith('.jsx')) { | ||
return url.slice(0, -4); | ||
} else { | ||
return url; | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,6 @@ | ||
export type { | ||
Environment | ||
} from './environment'; | ||
export type { | ||
RenderContext | ||
} from './context'; | ||
|
||
export { | ||
createBasicEnvironment, | ||
createEnvironment | ||
} from './environment.js'; | ||
export { | ||
createRenderContext | ||
} from './context.js'; | ||
export { | ||
getParamsAndProps, | ||
GetParamsAndPropsError, | ||
renderPage, | ||
} from './core.js'; | ||
export { | ||
loadRenderer | ||
} from './renderer.js'; | ||
export type { RenderContext } from './context'; | ||
export { createRenderContext } from './context.js'; | ||
export { getParamsAndProps, GetParamsAndPropsError, renderPage } from './core.js'; | ||
export type { Environment } from './environment'; | ||
export { createBasicEnvironment, createEnvironment } from './environment.js'; | ||
export { loadRenderer } from './renderer.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
export { | ||
default as renderer | ||
} from './renderer.js'; | ||
export { | ||
createAstroJSXComponent | ||
} from './component.js'; | ||
export { createAstroJSXComponent } from './component.js'; | ||
export { default as renderer } from './renderer.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.