Closed kwhitley closed 2 years ago
I don't expect people to be as sensitive to the bundle size for Cloudflare Workers as we are with SPAs. One dependency with many exports feels more approachable, and people who are super sensitive to the size might be able to do tree-shaking during the bundling process to remove unused code
Yeah, I tend to agree... certainly with Workers, it's more about the convenience and how much you mesh with the implementation (read: how does your code look afterwards and how easy was it to get there), assuming the bundle isn't crazy in size (you still have limits in the size of your script).
Do you plan to add TypeScript types for itty-router-extras
, or rewrite in TS?
Do you plan to add TypeScript types for
itty-router-extras
, or rewrite in TS?
For those, I plan to rewrite in TS... just easier than maintaining type files separately.
I think this is a great idea. Tree-shaking will limit the code in-memory for extras not used.
Closing this in favor of the actual PR https://github.com/kwhitley/itty-router/pull/121
So this is a rather big shift/departure from the previous setup, but here are the reasons:
itty-router/extras
catch-all, or more specific submodules likeitty-router/response
anditty-router/cors
anditty-router/middleware
. Honestly, they're probably all lightweight enough to keep all together for simplicity of end user code.... feedback welcome on this though.Thoughts?