0
Fork 0
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:
Matthew Phillips 2024-06-20 16:18:01 -04:00
parent cbdd13112b
commit 0dc3a315bf
7 changed files with 1 additions and 42 deletions

View file

@ -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 />

View file

@ -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": {

View file

@ -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,

View file

@ -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;
}

View file

@ -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` +

View file

@ -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;
}
}