[feat] chaining SvelteKit apps
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
The ssr middleware outputted by adapter-node is not a proper middleware because it never calls next(), making it impossible to compose it with other middlewares.
Describe the proposed solution
I'll submit a PR that'll introduce a new build option, handle404?: boolean:
- when set to true (or undefined),
handlerwill handle 404 errors and display a custom error page - when set to false,
handlerwill call the next middleware on 404
Alternatives considered
Make handler a pure middleware, and handle 404 in index.js, after handler:
It represents a significant amount of work but allows small performance improvements when using only handler.
Importance
i cannot use SvelteKit without it
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the adapter-node SSR middleware and the referenced packages/adapter-node/src/index.js entry point. Trace how handler currently handles 404 responses and how middleware composition would work. Done means the new handle404 option has the proposed default and false behavior, with tests covering both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100