D
Deno

help

Deno Emit

Aagorushkin9/25/2023
How come does deno bundle work a lot differently to Deno emit (https://deno.land/x/emit@0.28.0 )? When I try to bundle my react code, the code bundled by deno bundle works just fine, while the emit code is broken?
No description
Aagorushkin9/25/2023
Here is the deno.json as well
No description
Aagorushkin9/25/2023
And here is the bundle
No description
Aagorushkin9/25/2023
deno bundle code is also bigger by about 100 lines or so hmm
Aagorushkin9/25/2023
If using
const bundled = await bundle(src, { importMap: './deno.json', compilerOptions: { jsxFactory: 'preact.h' } });
const bundled = await bundle(src, { importMap: './deno.json', compilerOptions: { jsxFactory: 'preact.h' } });
Suggested 'preact.h' factory, the following error pops up
No description
Aagorushkin9/25/2023
Basically same as React
DAHDeno AI Helper9/25/2023
The Deno.emit() API and deno bundle command serve different purposes and work in different ways, which could explain the difference in the output of your React code. The Deno.emit() API was designed to allow transpiling and bundling source code programmatically. However, as per the documentation, this API was considered unstable and didn't fit well in the Deno namespace due to its complexity and the subtle edge cases it introduced. As a result, it was removed from the Deno namespace and provided as a userland module: deno_emit. On the other hand, the deno bundle command was designed to output a single JavaScript file for consumption in Deno, which includes all dependencies of the specified input. However, it's important to note that deno bundle has been deprecated and will be removed in some future release. The documentation recommends using deno_emit, esbuild, or rollup instead. The difference in the output of your React code could be due to the different ways these tools handle bundling. If you're experiencing issues with deno_emit, it might be worth checking if you're using the latest version, or if there are known issues with the version you're using. Remember, deno_emit is a userland module and might not handle all cases as deno bundle does. If you're having specific issues with deno_emit, it might be worth raising an issue in the module's repository or seeking help from the Deno community. 🦕
NTĐăng Tú9/25/2023
I don't think you can use deno bundle for browser environment.
NTĐăng Tú9/25/2023
No description
Aagorushkin9/25/2023
But it does work though aye
NTĐăng Tú9/26/2023
Well, they said depends on the input, but it's up to you to decide if you want to check carefully every API and lib you will use for client or you will use a different tool.

Looking for more? Join the community!

Recommended Posts
`deno lsp` does not understand bare imports without prefixEven in minimal project, freshly created from a template, Deno marks imports as errors and doesn't uWhen I use crypto in this code, it returns 'Unknown cipher.'const secret ="**1111111111111111111**"; let encryptedText='test'; const decipher = crypto.cTroubleshooting deno.land downloadsI have docker containers, within a minikube cluster, that have trouble downloading https://deno.landRun remote Fresh application code locally.Is it possible to run a remotely hosted Fresh application? E.g. I'm attempting to do `deno run -A hmigrate from node to deno: p5js projectHi, I want to rewrite my p5js project built with nodejs in deno. Here is my code: https://github.coPeer dependencyCan I somehow mark a dependency as "peer"? So this dependency (which is known to shuffle typings bet'Spawn' multiple promises from the same moduleI'm trying to use Deno for scripted npcs in a game, the main issue that the npc has to await user acReturn results from execute_main_moduleI currently have this function to run some execute some js ``` pub async fn run(&self, path_to_Fresh Blog + Website Thingshttps://vuepress-theme-yuu.netlify.app/, what is the closest thing to that which can be run on FreshDetermine subcommandIf I run `deno test` from the command line, how can I determine that `test` is the subcommand being setting a cookie for import requestsis there a way to modify request headers or set cookies for the GET requests that deno makes when reHow to run tailwindcss cli with deno task?I would like to be able to run the tailwindcss cli tool to watch and build stylesheets as per their Deno DeployIs it possible to use only cronjobs on deno deploy?Deno cannot import mainfile by reading from package.jsondeno 1.36.0 (release, x86_64-unknown-linux-gnu) v8 11.6.189.12 typescript 5.1.6Deno LSP in a Web WorkerHas anyone come across the lsp running in a web worker? I have an online editor (Monaco) that peopleHow do you get a Deno Jupyter notebook to recognize Deno and other types in vscode?See attached screenshotModule not found when running deno runSomething weird has started happening. When I run `deno run src/main.ts` it seems as if Deno is tryesm_entry_point / extension macro; ReferenceErrorHow do I use esm_entry_point properly? I defined my extension as: ```rust extension!( ext_name,remoteAddr returning localhost on Deno DeployI saw this thread (https://discord.com/channels/684898665143206084/1055631150787334184) about gettinDeno-native Nuxt.js?The recent [The State of Web Frameworks on Deno](https://deno.com/blog/web-frameworks-on-deno) blog