3 ms·
Aren't the "defineApp" and "route" methods in rwsdk also magic? It feels like rwsdk is just being more deliberate about when and where to introduce those magic
by chipgap98 1y ago
Aren't the "defineApp" and "route" methods in rwsdk also magic? It feels like rwsdk is just being more deliberate about when and where to introduce those magic functions.
I'm a big fan of rwsdk so far. Thanks for building!
- pistoriusp 1y agoNope! They just return standard JavaScript. A typical worker looks something like this: export default { fetch({ request }) { return new Response('ok') } } DefineApp just wraps that initial entry point into something that allows us to run middleware, match the router, and render out the page or the response object. Love that you're a fan! Remember... No magicians allowed here.
- gadfly361 1y agoI think a notable difference is with one, you can read the code in the file and understand what it will return. With others, you need to read the code and then do a mental join of the framework's conventions to know what it'll return.