-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(@angular/build): utilize ssr.entry
in Vite dev-server when available
#28463
feat(@angular/build): utilize ssr.entry
in Vite dev-server when available
#28463
Conversation
765134d
to
c0315fb
Compare
5024073
to
8b3bad2
Compare
6aa75e1
to
09224fa
Compare
… URL parameter Modified the `HtmlTransformHandler` type to accept a context object containing a URL and HTML content. This change supports the `html:transform:pre` hook, enhancing the handler's capability to process transformations based on the request URL.
1dd5a11
to
be51ae1
Compare
cb30910
to
aad619f
Compare
aad619f
to
3ed259c
Compare
3ed259c
to
22d7c3c
Compare
036f598
to
07311d7
Compare
9030fa2
to
af442de
Compare
…ilable When `ssr.entry` (server.ts) is defined, Vite will now use it in the dev-server. This allows API and routes defined in `server.ts` to be accessible during development. This feature requires the new `@angular/ssr` APIs, which are currently in developer preview.
…Handler `utilities Introduced the `createRequestHandler` and `createNodeRequestHandler` utilities to expose middleware functions from the `server.ts` entry point for use with Vite. This provides flexibility in integrating different server frameworks, including Express, Hono, and Fastify, with Angular SSR. Examples: **Express** ```ts export default createNodeRequestHandler(app); ``` **Nest.js** ```ts const app = await NestFactory.create(AppModule); export default createNodeRequestHandler(app); ``` **Hono** ```ts const app = new Hono(); export default createRequestHandler(app.fetch); ``` **Fastify** ```ts export default createNodeRequestHandler(async (req, res) => { await app.ready(); app.server.emit('request', req, res); }); ```
Improve code structure
af442de
to
84936cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider consolidating some of the E2E test logic here at some point.
Otherwise, LGTM.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
feat(@angular/build): utilize
ssr.entry
in Vite dev-server when availableWhen
ssr.entry
(server.ts) is defined, Vite will now use it in the dev-server. This allows API and routes defined inserver.ts
to be accessible during development. This feature requires the new@angular/ssr
APIs, which are currently in developer preview.feat(@angular/ssr): add
createRequestHandler
andcreateNodeRequestHandler
utilitiesIntroduced the
createRequestHandler
andcreateNodeRequestHandler
utilities to expose middleware functions from theserver.ts
entry point for use with Vite.This provides flexibility in integrating different server frameworks, including Express, Hono, and Fastify, with Angular SSR.
Examples:
Express
Nest.js
Hono
Fastify