Replies: 3 comments 6 replies
-
Hi, thanks for opening up the discussion.
Yeah, but it's not a priority as we have so many issues/tasks piled, including revamping config system and so on.
I don't think they are user configs. So, we may need a new mechanism other than the
Hm, that makes me think that a build adapter can be a vite plugin. |
Beta Was this translation helpful? Give feedback.
-
I definitely understand the desire to keep the Hono & Vite dependencies minimal However, given that deployment logic is mostly undifferentiated work, could we integrate Hono's existing adapter system and extend it with lifecycle hooks (e.g. IMO this would be the ideal solution. Even better if - as an end-user - I can just The biggest challenge we're seeing with RSCs now is they're very difficult to get working in a way that's dev and bundler-friendly. And there's already very few devs capable of contributing to the existing challenges. So the rationale of this strategy is to free up dev resources to focus on issues specific to React 19, RSCs, etc. These are just my thoughts atm. Maybe I'm missing something obvious why we can't do it this way :) |
Beta Was this translation helpful? Give feedback.
-
Related PRs: |
Beta Was this translation helpful? Give feedback.
-
I've seen it mentioned that this project plans to revamp the build adapters before 1.0. Here are some ideas.
For the Cloudflare Pages adapter, I needed the public files to go into the root of the build folder and needed to create a _routes.json file to ignore them.
I'm now working on an AWS adapter - using SST Ion - and it needs the public folder separated out to upload to S3 and also needs to configure cloudfront routes to send the public assets to the s3 origin and send the rest of the routes to a Lambda function. You don't want it to bundle the public assets in with the Lambda function to keep the container size down.
It would be great if a few options could be moved into
Config
that are currently hard-coded within thebuild
function. The DIST_SERVE_JS and DIST_PUBLIC values in packages/waku/src/lib/builder/constants.ts could be moved toConfig
. It would be great to addfunctionDir
to output all of the server code into a sub-folder. The way the rscServePlugin gets added in the build could be customizeable from Config. So in Config, that would be:For Cloudflare Pages, it could use
_worker.js
as the functionDir folder and set.
as the publicDir. So the build would output public to dist and the rest to dist/_worker.js. Or in my AWS build, I could do dist/public and dist/function.The other common item needed for build adapters is a manifest of the public assets. Maybe the build function can return that. In the Cloudflare Pages case, it would then write a _routes.json file. In the AWS SST Ion case, it would create Cloudfront origin routes based on the manifest.
The various
emit*Output
functions could eventually be removed. Instead a build adapter could alter the default Config values, call the build function and then do additional operations on the build output.It would probably be nice to have a hook to transform the Vite configs too. I'd like to enable sourceMaps, for example (although I saw there's a rollup issue, so maybe that isn't ready anyway).
Beta Was this translation helpful? Give feedback.
All reactions