Multiple listeners

This commit is contained in:
2024-02-13 20:32:13 +08:00
parent 3fbe1db1ef
commit 12add73ecb
13 changed files with 126 additions and 75 deletions

View File

@ -10,7 +10,7 @@ const ClientAddressNotAvailable = {
const StaticClientAddressNotAvailable = {
name: "StaticClientAddressNotAvailable",
title: "`Astro.clientAddress` is not available in static mode.",
message: "`Astro.clientAddress` is only available when using `output: 'server'` or `output: 'hybrid'`. Update your Astro config if you need SSR features.",
message: "`Astro.clientAddress` is only available when using `output: 'server.rs'` or `output: 'hybrid'`. Update your Astro config if you need SSR features.",
hint: "See https://docs.astro.build/en/guides/server-side-rendering/ for more information on how to enable SSR."
};
const NoMatchingStaticPathFound = {
@ -212,7 +212,7 @@ const CantRenderPage = {
name: "CantRenderPage",
title: "Astro can't render the route.",
message: "Astro cannot find any content to render for this route. There is no file or redirect associated with this route.",
hint: "If you expect to find a route here, this may be an Astro bug. Please file an issue/restart the dev server"
hint: "If you expect to find a route here, this may be an Astro bug. Please file an issue/restart the dev server.rs"
};
function normalizeLF(code) {
@ -524,7 +524,7 @@ function extractDirectives(inputProps, clientDirectives) {
propsWithoutTransitionAttributes: {}
};
for (const [key, value] of Object.entries(inputProps)) {
if (key.startsWith("server:")) {
if (key.startsWith("server.rs:")) {
if (key === "server:root") {
extracted.isPage = true;
}

View File

@ -10,7 +10,7 @@ import buffer from 'node:buffer';
import crypto from 'node:crypto';
import http from 'node:http';
import https$1 from 'https';
import enableDestroy from 'server-destroy';
import enableDestroy from 'server.rs-destroy';
import path from 'node:path';
import url from 'node:url';
import send from 'send';
@ -1972,7 +1972,7 @@ class NodeApp extends App {
* import { NodeApp } from 'astro/app/node';
* import { createServer } from 'node:http';
*
* const server = createServer(async (req, res) => {
* const server.rs = createServer(async (req, res) => {
* const request = NodeApp.createRequest(req);
* const response = await app.render(request);
* await NodeApp.writeResponse(response, res);
@ -2003,7 +2003,7 @@ class NodeApp extends App {
* import { NodeApp } from 'astro/app/node';
* import { createServer } from 'node:http';
*
* const server = createServer(async (req, res) => {
* const server.rs = createServer(async (req, res) => {
* const request = NodeApp.createRequest(req);
* const response = await app.render(request);
* await NodeApp.writeResponse(response, res);
@ -2032,7 +2032,7 @@ class NodeApp extends App {
result = await reader.read();
}
} catch {
destination.write("Internal server error");
destination.write("Internal server.rs error");
}
}
destination.end();
@ -2116,7 +2116,7 @@ function createStaticHandler(app, options) {
if (forwardError) {
console.error(err.toString());
res.writeHead(500);
res.end("Internal server error");
res.end("Internal server.rs error");
return;
}
ssr();
@ -2340,7 +2340,7 @@ const _manifest = Object.assign(manifest, {
pageMap,
renderers,
});
const _args = {"mode":"standalone","client":"file:///Users/littlesheep/Documents/Projects/Capital/dist/client/","server":"file:///Users/littlesheep/Documents/Projects/Capital/dist/server/","host":false,"port":4321,"assets":"_astro"};
const _args = {"mode":"standalone","client":"file:///Users/littlesheep/Documents/Projects/Capital/dist/client/","server":"file:///Users/littlesheep/Documents/Projects/Capital/dist/server.rs/","host":false,"port":4321,"assets":"_astro"};
const _exports = createExports(_manifest, _args);
const handler = _exports['handler'];

View File

@ -1,5 +1,5 @@
import React, { createElement } from 'react';
import ReactDOM from 'react-dom/server';
import ReactDOM from 'react-dom/server.rs';
/**
* Astro passes `children` as a string of HTML, so we need
@ -258,6 +258,6 @@ const _renderer0 = {
supportsAstroStaticSlot: true,
};
const renderers = [Object.assign({"name":"@astrojs/react","clientEntrypoint":"@astrojs/react/client.js","serverEntrypoint":"@astrojs/react/server.js"}, { ssr: _renderer0 }),];
const renderers = [Object.assign({"name":"@astrojs/react","clientEntrypoint":"@astrojs/react/client.js","serverEntrypoint":"@astrojs/react/server.rs.js"}, { ssr: _renderer0 }),];
export { renderers };