-
Notifications
You must be signed in to change notification settings - Fork 37
fix: allow for use of both manual & fetchEvent based HTTP #247
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
fix: allow for use of both manual & fetchEvent based HTTP #247
Conversation
bf0c88d
to
16b39ad
Compare
e86e516
to
95b0742
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.
Thank you! I wouldn't mind additional tests, for example for pure components that you mention in the docs, but otherwise LGTM! 🚀
a6faf1d
to
057a7c5
Compare
Also @tschneidereit before you run into this.. I have already split out the PRs so they're a bit easier to review: I'll do the required PR fixups regardless of which you merge in what order! |
This commit updates the componentize-js code to support both fetchEvent and manual based HTTP. To make this possible we needed to re-introduce a few things: - A feature that represents fetch-event - Allow controlling removal of the the built-in fetch event - Allow skipping checks for manual wasi:http/incoming-handler impls - Add oxc-parser to detect manual impls and toggle fetch-event feature The docs are also updated to note the changes to API/usage.
5cefd26
to
327dc46
Compare
Hey @tschneidereit -- I've rebased this to |
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.
Let's get this landed. There are a couple of things I'd prefer to have different, but absolutely don't want to block getting this in on them:
It'd be nice if we could, on a best-effort basis, detect usage of FetchEvent
when auto-disabling support for it. That'd be possible using oxc, but somewhat gnarly. Basically, it'd require walking the AST, finding all function calls to the identifier addEventListener
, and checking if the first argument is the string literal "fetch"
. Obviously there are ways to create both false positives and negatives, but those are unlikely enough for a warning not to be a problem, I think.
The more important thing is that I thought we had agreed to have the parsing happen in Rust instead of JS. That'd both better support using the splicer as a Rust dependency, and be faster.
Again, we should absolutely land this without addressing either of these!
Made an issue so that we don't forget to come back to the fetch event detection to improve it! |
This commit updates the componentize-js code to support both fetchEvent and manual based HTTP.
To make this possible we needed to re-introduce a few things:
The docs are also updated to note the changes to API/usage.