Title: Plugin api: raw-body mode for plugins that wrap node-style handlers · Issue #583 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: Plugin api: raw-body mode for plugins that wrap node-style handlers · Issue #583 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: Plugin api: raw-body mode for plugins that wrap node-style handlers · Issue #583 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Split out of #206 (plugin-zero results comment): second seam forced by mounting Tideholm inside JSS. Problem Fastify's content parsers consume the request stream before handlers run. A plugin that hands requests to an existing node-style...
Open Graph Description: Split out of #206 (plugin-zero results comment): second seam forced by mounting Tideholm inside JSS. Problem Fastify's content parsers consume the request stream before handlers run. A plugin that ...
X Description: Split out of #206 (plugin-zero results comment): second seam forced by mounting Tideholm inside JSS. Problem Fastify's content parsers consume the request stream before handlers run. A plugin t...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/583
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Plugin api: raw-body mode for plugins that wrap node-style handlers","articleBody":"Split out of #206 (plugin-zero results comment): second seam forced by mounting [Tideholm](https://github.com/melvincarvalho/tideholm/tree/gh-pages/jss-plugin) inside JSS.\n\n## Problem\n\nFastify's content parsers consume the request stream before handlers run. A plugin that hands requests to an existing node-style handler (`(req, res)` — any wrapped HTTP app, reverse proxy, or framework adapter) then blocks forever: the wrapped app listens for `data`/`end` on a stream that has already been drained. This cost an hour of debugging in the Tideholm adapter and will bite every plugin of this shape.\n\n## Workaround today (works, but is folklore)\n\nScoped registration with a pass-through parser, plus `reply.hijack()`:\n\n```js\nawait fastify.register(async (scope) => {\n scope.removeAllContentTypeParsers();\n scope.addContentTypeParser('*', (req, payload, done) => done(null, payload));\n scope.all(prefix, handler); // handler: reply.hijack(); app.handle(request.raw, reply.raw)\n scope.all(prefix + '/*', handler);\n});\n```\n\n## Proposal\n\nWhen the #206 loader lands, `api.fastify` (or a helper like `api.mountApp(prefix, nodeHandler)`) should offer this as a declared mode — e.g. `rawBody: true` in the plugin manifest or register options — so plugin authors never rediscover the scoped-parser incantation. `api.mountApp` is the stronger shape: it can bundle the prefix registration, the parser escape, the hijack, and the appPaths WAC exemption (see sibling issue) into one call, since every wrapped-app plugin needs all four together.\n\n## Acceptance\n\n- [ ] A plugin can declare/mount a node-style handler and receive unconsumed request bodies\n- [ ] Host content parsing unaffected outside the plugin's scope\n- [ ] Test: JSON POST through a mounted node handler round-trips (the exact Tideholm demo case)\n- [ ] Documented in the plugin-author docs alongside #206's manifest format","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-07-10T11:39:28Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/583"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2101fd49-c0a4-f46a-b3cb-aa68fc18c539 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ECEE:D500:2A369BE:37AF216:6B038A21 |
| html-safe-nonce | ee9904f721b734e8db578a85670dd086365cd7158c37b0e8a11aa6c358f89762 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0VFOkQ1MDA6MkEzNjlCRTozN0FGMjE2OjZCMDM4QTIxIiwidmlzaXRvcl9pZCI6IjE3MDk5MjU4MTYzMzY2MTU5NjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f9b61f88afe4dfd83eb1bfb8b7aca64af84697499098c95105c5985c24e20033 |
| hovercard-subject-tag | issue:4854658723 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/583/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ad7ead2417b45756f20b47b92aaabc3f7d6f9f2aa96b7323dc6a09069ec930db/JavaScriptSolidServer/JavaScriptSolidServer/issues/583 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ad7ead2417b45756f20b47b92aaabc3f7d6f9f2aa96b7323dc6a09069ec930db/JavaScriptSolidServer/JavaScriptSolidServer/issues/583 |
| og:image:alt | Split out of #206 (plugin-zero results comment): second seam forced by mounting Tideholm inside JSS. Problem Fastify's content parsers consume the request stream before handlers run. A plugin that ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width