feat(cloudflare): Add support for txt and bin cloudflare specific module types#251
Conversation
🦋 Changeset detectedLatest commit: f078e77 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
e52355b to
a0a031e
Compare
a0a031e to
cb112aa
Compare
|
@adrianlyjak yeah a docs pr to the docs repo is needed :) |
alexanderniebuhr
left a comment
There was a problem hiding this comment.
@adrianlyjak Thanks for the contribution, very happy to have it ❤️
As already said, this needs a companion docs PR in the docs repo. (fyi @sarah11918)
I personally like that you took the step to still support the old flag, so we can ship this as a minor.
txt and bin cloudflare specific module types
cb112aa to
90ee0d3
Compare
|
@alexanderniebuhr @sarah11918 initial merge request for doc updates is here withastro/docs#8211. Let me know if you have any feedback! |
90ee0d3 to
64fac3f
Compare
|
Thanks for the update. Will review both PR's ;) |
* Updated docs for withastro/adapters#251 * fix spelling/grammar in cloudflare modules documentation Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> Co-authored-by: Alexander Niebuhr <alexander@nbhr.io>
A follow on feature to #249
Changes
.binand.txtfiles within cloudflare pages functionswasmrelated code and config options tomodule-loaderto clarify that this supports multiple formatswasmModuleImportstocloudflareModules, retaining the previous so that this is non-breaking..wasmimports instead of only.wasm?moduleimports to be consistent with cloudflare pageswasmModuleImportsby default. Initially we'd decided to keep this opt-in so as to keep the hacky branching from breaking the build: feat(@astrojs/cloudflare): Add support for wasm module imports astro#8542 (comment). There's no more branching, so now the vite plugin here is doing close to nothing except for string comparisons if there's no matching import, so it seems safe to me now. (You'd effectively be opting in by importing the right file format)wrangler.tomlrules(if cloudflare pages gets support for that, right now it seems to be workers only)Testing
Docs
I changed the name from
wasmModuleImportstocloudflareModulesin the cloudflare config. The old parameter is still available, but marked as deprecated. Any opinions around terminology here? Most everything I come up with ends up sounding generic, IMO, its hard to name this feature, so I was just going off terminology that cloudflare uses https://developers.cloudflare.com/pages/functions/module-support/.What's the process for updating documentation? Should I make an associated merge request in the docs repo? https://github.com/withastro/docs/blob/main/src/content/docs/en/guides/integrations-guide/cloudflare.mdx