-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
breaking: string only waku.config.ts #1281
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
@rmarscher I get a weird error with |
It seems we will lose type checking for middleware in waku config file. Would you consider supporting both |
It looks like |
I'm curious what is the reason for this change. Does it enable hot reload for middleware code? Or some other use case for the middleware to be imported within the vite context? |
@@ -17,6 +17,8 @@ const CONFIG_FILE = 'waku.config.ts'; // XXX only ts extension | |||
export function rscEntriesPlugin(opts: { | |||
basePath: string; | |||
rscBase: string; | |||
middleware: string[]; |
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.
I can follow up this PR with type suggestions for the waku supported plugins if you're open to it. It would still allow any string, but suggest the built in ones.
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.
Can you highlight your idea with a few lines of code?
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.
playground: https://tsplay.dev/we3Xem

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.
Thanks. I see this doesn't break anything. Not sure how much it helps because it's very unlikely to people to type it. (Besides, this isn't a fix for the regression.)
I don't think we need it at least in this PR.
The goal of string-based config is to avoid leaking runtime code in the config file. It's cleaner if we could separate them. It relates to hot reload, but it's secondary (not the goal of this PR). So, in a word, it's a security concern. |
It's much easier in that case. Let me see. Hmm, but it's still "build" from the waku perspective. I'll see |
It still doesn't work. It fails with building. |
It's my misunderstanding. Now, it builds fine with @rmarscher Can you look into how e2e is failing? |
cd examples/07_cloudflare
pnpm run build
pnpm run start I am getting an error:
It is coming from here: const htmlHead = !devServer && entriesPrd.dynamicHtmlPaths.find(([pathSpec]) => getPathMapping(pathSpec, ctx.req.url.pathname))?.[1] || "";
Are you seeing the same error? |
Oh, yeah, I didn't notice it when I run it previously. This should be fixable. Thanks. |
This is for v0.22.0.
Previously, waku.config.ts allows to put functions directly. Instead of that, this one is to take strings only.
Here's the patch for 38_cookies examnple:
Tasks:
--with-cloudflare