@deno/emit's transpile with JSR
Do I miss something or @deno/emit don't work with JSR? I am trying to do JSX DOM Client Component, hono/jsx/dom, not just hono/jsx which is SSR.
I'm also surprise this emit package is not in @std but in a strange @deno, its legit?
server.tsx
client.tsx
Termial output
deno.json
I need this deno compilerOptions for my hono/jsx SSR config
9 Replies
I'd recommend esbuild with the deno plugin. That is what fresh uses to bundle/transpile preact in their fresh framework. I've been able to use esbuild for react too without issue importing from jsr.
I would love something on the fly like Fresh used to be, isn’t with the past Deno.emit() call now replaced with package @deno/emit
⬆️
idk what you mean by on the fly like fresh used to be. What is different about it now?
No build steps
App is slower without a build step. That's because each time the process restarts, it needs to regenerate the build before it can start handling requests for the build artifacts. The documentation says you can make the server command automatically restart itself by adding the --watch flag. The app would still need to be rebuilt for changes. Before it was just hidden because it would generate the build internally when the build files are requested. It's still being built with esbuild. Cold process startups are now quicker because of the build step not needing to run every time.
I really don’t care it’s slower, 99.99% of application don’t need speed. The only reason I’m on Deno is for no build
Do you know how can I manage to do it?
Yea I know how you could but I don't think you understand, "no build" still had to build your app, you just didn't get to see it happening. It happened everytime you start your server. "no build" was more like "build included" since it built the app on every run instead of only when needed.
Now it creates the files instead of building them and keeping them in ram.
Yes I want it in RAM man please 🙏🏾
I really don’t know how to do it with hono. My index.html is loaded from
/
from static, then it ask for client.js, and this is why I tried to use the @deno/emit’s transpile call.
Even better can I just strip the ts stuff without types checkJust create a getBuild function and have it generate the build files to memory. I believe there is a esbuild configuration option for that, which fresh used. Then if a request comes in for one of them, have it wait until the build files were generated by esbuild before responding to requests for the build files. If someone connects before the build finishes, they will just have a longer request time.