mirror of
https://github.com/withastro/astro.git
synced 2025-02-03 22:29:08 -05:00
Remove extra stuff
This commit is contained in:
parent
cbdd13112b
commit
0dc3a315bf
7 changed files with 1 additions and 42 deletions
|
@ -1,28 +0,0 @@
|
|||
---
|
||||
export const prerender = false;
|
||||
export const partial = true;
|
||||
|
||||
// @ts-ignore
|
||||
import { islands } from 'astro:internal/server-islands';
|
||||
|
||||
type RenderOptions = {
|
||||
componentPath: string; // TODO remove
|
||||
componentExport: string;
|
||||
props: Record<string, any>;
|
||||
slot: Record<string, any>;
|
||||
}
|
||||
|
||||
const { method } = Astro.request;
|
||||
if(method !== 'POST') {
|
||||
// TODO return error
|
||||
}
|
||||
|
||||
const json = await Astro.request.text();
|
||||
const options: RenderOptions = JSON.parse(json);
|
||||
|
||||
const module = await islands[options.componentPath]();
|
||||
const Island = module[options.componentExport];
|
||||
|
||||
// TODO check auth
|
||||
---
|
||||
<Island />
|
|
@ -80,7 +80,6 @@
|
|||
"types": "./dist/core/middleware/index.d.ts",
|
||||
"default": "./dist/core/middleware/index.js"
|
||||
},
|
||||
"./server-islands/endpoint": "./dist/core/server-islands/endpoint.js",
|
||||
"./virtual-modules/*": "./dist/virtual-modules/*"
|
||||
},
|
||||
"imports": {
|
||||
|
|
|
@ -14,7 +14,6 @@ import {
|
|||
import { createVite } from '../create-vite.js';
|
||||
import type { Logger } from '../logger/core.js';
|
||||
import { apply as applyPolyfill } from '../polyfill.js';
|
||||
import { injectServerIslandEndpoint } from '../server-islands/config.js';
|
||||
|
||||
export interface Container {
|
||||
fs: typeof nodeFs;
|
||||
|
@ -52,7 +51,6 @@ export async function createContainer({
|
|||
});
|
||||
|
||||
settings = injectImageEndpoint(settings, 'dev');
|
||||
settings = injectServerIslandEndpoint(settings);
|
||||
|
||||
const {
|
||||
base,
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
import type { AstroSettings } from '../../@types/astro.js';
|
||||
|
||||
export function injectServerIslandEndpoint(settings: AstroSettings) {
|
||||
/*settings.injectedRoutes.push({
|
||||
pattern: '/_server-islands/[name]',
|
||||
entrypoint: 'astro/components/_ServerIslandRenderer.astro',
|
||||
});*/
|
||||
|
||||
return settings;
|
||||
}
|
|
@ -26,6 +26,7 @@ export async function renderEndpoint(
|
|||
);
|
||||
}
|
||||
if (handler === undefined) {
|
||||
|
||||
logger.warn(
|
||||
'router',
|
||||
`No API Route handler exists for the method "${method}" for the route "${url.pathname}".\n` +
|
||||
|
|
|
@ -160,7 +160,6 @@ export class DevPipeline extends Pipeline {
|
|||
// First check built-in routes
|
||||
for(const route of this.defaultRoutes) {
|
||||
if(route.matchesComponent(filePath)) {
|
||||
debugger;
|
||||
return route.instance;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue