-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate "deno bundle" #11073
Comments
If we were to do that, then |
I can see why it is done because there are alot of bundler's that already provide the same or more than
|
I personally will always vote for making At least how I see it, |
@bartlomieju To clarify (for other people) "deno bundle" can be deprecated and removed without effecting "deno compile", but in order to remove the swc_bundler dependency, we'd need to do some work to "deno compile" maybe to use something like the eszip json file format instead. |
While true, that can be said for nearly all of our subcommands. I'm against just because we're taking away a useful (albeit, needs some tic) feature from our promise of being a one stop toolchain. |
My first reaction was “no”. Then I thought about it a little bit and still “no”. |
I think the main difference here is that On the note about complexity, I believe userland already has and will be able to provide better versioned APIs that aren't tied to the deno executable in order to solve this problem. They'll be able to provide features like code splitting, transforms, and such that would be unreasonable to add to |
But Deno explicitly invests work to be as browser compatible as possible, so I do not see how it does not fit - I see more potential to standardize an almost required part of the toolchain that people spend a ridiculous amount of time on right now (choosing one of 6 tools and 6273 meta frameworks that configure them) without writing actual code to solve their actual problem.
Deno's philosophy is to have a one stop toolchain - that does not prevent people from writing userland alternatives but I still do not see how the option of alternatives defeats the purpose of a central standardized toolchain that will see a lot of use because it is convenient.
Why are they unreasonable? |
I'm just saying there's a difference between
For example, implementing transforms would expose a huge amount of API that rapidly changes under the hood. People would be relying on what's available in the deno executable rather than a semantically versioned API. Using a versioned imported module would provide more stability and likely work no matter what version of the deno executable is used (since they're not tied together). For code splitting and more advanced bundler features it would require config or to expand the complexity of |
I'm mixed on this. On the one hand, bundlers are a rabbit hole that doesn't seem to ever end. We're in an interesting place right now since we're bundling swc in the runtime itself, so while esbuild and swc compiled to wasm are probably fast enough, a truly native solution is most likely faster. I think a sensible course of action would be to remove the |
This is really a fascinating discussion! There are a lot of things that come to mind:
If Deno is able to articulate a bundling vision much the way it has for other aspects of itself, It may make sense to leave it in core. To me that would look like taking a minimal stance and saying "sorry, we don't think you should be running 4 different html/css/js transpilers in your build system, etc." We have an ecosystem that has gorged itself on tools. Enough is enough. :) |
I remember standing on a stage with you Ry at TSConf and stating that "Deno CLI will be the only tool you need" and now you are suggesting backing away from that. I am not supportive, as it fundamently goes against what I thought we were trying to accomplish. Changing the infrastructure so that there are less issues with |
@kitsonk Deno CLI is still the only tool you need to do bundling, even if you remove
The alternative is that |
So are we deprecating
As we talked earlier, we should be talking in use cases of problems we are trying to solve. Drawing a line around what you do is one thing, deprecating core functionality because it is hard is another. |
I completely agree with @kitsonk here. In relation to |
That's definitely true, but I'm thinking about it an inverted way; If my project can't be bundled with deno, it's on me to drop all the stupid crap that today's bundlers do and pare down to a reasonable bundle capability that deno already provides. I'm trying to align my project to work with Deno's vision of a minimalistic modern js runtime. I don't know if I want deno to adopt these other unhealthy practices, even though it's very practical to do so today. If I want a bunch of bloated bundling logic including bits for commonjs plugins etc., why don't I just use node? |
@lucacasonato is it incredibly useful? How are people using it? It seem odd to me that Deno claims to be web compatible, but "deno bundle" explicitly does not produce bundles for browser.
I agree - I'm conflating the problems here... |
that's a really interesting point. Maybe it makes sense to specifically (re-?)define the purpose of If we were to define that as the specific purpose, could we declare the bundle command as done, and just shrug off the infinite bundling feature requests? |
Bundling Deno programs for deployment to a server. The bundle is then just a single file you can plop onto a VPS or into a Docker image. Startup is greatly improved because no downloads or emits have to happen at startup.
It does not explicitly not create bundles for the browser (quite the opposite, they work fine there), it just is not it's primary focus as far as I can tell. The intension is to use |
Yes. Creating dependency-less bundles of Deno code qt a specific version, sometimes to have a single distributable with Node.js or a browser as a "library". Effectively a build step. There are other comments in this thread where people have uses which you seem to be ignoring.
Now you are changing your previous statements again. We always said that Deno would adopt web platform APIs where suitable, so that it is easier to move code between Deno and the Web, not to be headless Chrome. |
I think this is the most compelling use case though I think
This is where I think there are userland tools that are better or have the potential to better meet this need. For example, something that even transpiles the |
It is alot slower to use compiling in a JavaScript tool chain. Plus you would have to install a 75 MB binary each time your project has an update. |
From the stated goals as listed in the Deno manual...
I'm primarily a front end web developer. I can say from personal experience I hate the high levels of complexity, configuration, language-manipulation magic involved with the node bundling ecosystem. One of the core things that attracted me to Deno was that it was going to be straightforward and follow the language implementations of the browser. The goal stated above, (which
And that's it. No complex tool chains or plugins or configuration needed. Not to say there aren't use cases that are more demanding, but I don't see why they couldn't build on top of or just be separate from the basic functionality Deno provides. I don't need to import my CSS into my JS. I can use other tools purpose built to be a dev server (the snowpack mentality, non-bundled es modules are great in dev environments). I don't mind (at all) writing file extensions in my P.S. Thank you to all the maintainers that work on Deno. I realize you've put in a ton of time and effort and that managing an open source project can be a thankless task where people have baseless expectations that their every demand will be met. I hope this didn't come across that way, just sharing my use case. |
Partially. It doesn't make it easy to combine "lib a" and "lib b" and have something that is deployable. As other stated, just copying the binary as well is painful/useless in some instances. One can also do a It isn't just about my deployments, it is about making code available to others simply, without having to worry about resolving dependencies. |
I'm not sure we should encourage users to ship libraries with their dependencies bundled (libraries distributing minified bundles would be terrible for debugging #6900). I think that should be up to the user making the final distribution of an application (not a library) to make those decisions rather than midway through the dependency graph. Additionally, it makes it more difficult to understand what depedencies a library is pulling in... which makes it harder to catch the same dependency used multiple times (so it might be included multiple times in the final output), or duplicate dependencies with different versions, or to analyze code for auditing purposes.
Running Additionally, a huge advantage of |
Not if we fully solve #8577 (WIP PR at #10698). The same thing could be argued for
These are good potentially good practices, given specific contexts. I don't see them as being material do the
They solve different problems differently. |
I feel that too complicated bundle is a big problem not only for Deno but also for Javascript itself. |
We need If |
...I just upgraded, saw the deprecation warning, and dug up this thread 1. What happened to this???> I'm retracting this idea after reading through the discussion above.I was biting my nails in 2021 reading this thread until I saw that^. It still worried me a little bit, but I thought I was good to invest my time into Deno and have never looked back. I told my friends "Deno is amazing because it does the minimum nessary without missing a single thing; the Deno team just 'gets it' ". 2. I love bundle the way it is(and I don't care whether or not its renamed)I already use esbuild, packup, vite, parcel, webpack, snowpack, etc for my web projects, who doesn't??? The whole point, literally 100% of the reasons people use
Bundle might as well be called |
@jeff-hykin I agree, I was using I am going to see if I can find some solution in a similar spirit so I can serve some of my codebase to the client without spending hours reading documentation and StackOverflow posts about some whole other thing like esbuild. I'm tired of bundlers, tired of NPM... that's why I liked Deno. |
It doesn't make up the loss of simplicity Deno Emit and Bundle offered, but lately I've been using Lume for purely front-end work (as in, no static generation), and found its ESbuild plugin to be the closest thing to the no-fuss NPM-less tooling dream that we lost. I just write my HTML as Markdown files (no changes to the content), CSS as is, and all code as Typescript with standard ESM modules, and have even used packages like Lit from NPM. And "it just works". |
Thanks for the feedback, we hear you and are looking into potential solutions to the problem. |
@ others. I was sad at the lack of reasoning/discussion (seems to me like deprecation came out of the blue), I came across the location of the follow-up discussion #15463 |
@bartlomieju, the "were looking into it" could come across as apathetic without (and kind of even with) that^ context. Kinda like my bank's automated "your call is very important to us, please stay on the line". I know from the discord and office hours that you (@bartlomieju) and the team seem like great guys. I want to be on your side and support/defend the teams reasoning. "we will ensure Deno is a platform others can build on with trust" was in the heart of the announcement of the Deno Company, and I still believe you guys want that. Which is why I'm really confused when features are removed without a full dicussion, a The points I think are critical to address are:
Last, I think there's an incomplete discussion around SWC, module fragments, and scope creep from the linked issue. So I'll try to continue from the parts I believe are dangling:
|
The feature wasn't really removed. It was moved to deno_emit. You can see usage instructions for bundling from a JS api here: https://github.com/denoland/deno_emit/blob/main/js/README.md#bundle
You can read about the deprecation here: https://deno.com/blog/v1.31#deno-bundle-deprecation
That issue is closed. There are no long term plans to support deno pack at the moment.
It doesn't require bundling. It uses eszip internally: https://github.com/denoland/eszip
This would introduce yet another JS/TS parser in Deno and create a lot of complexity. For one, esbuild is also written in Go and not Rust. Also, esbuild has a versioned API with a lot of complexity. Something built into the runtime needs stability going forward. Using something with a JS api is preferable to support complex use cases IMO. Btw, esbuild is used in fresh: https://github.com/denoland/fresh
Again, see deno_emit: https://github.com/denoland/deno_emit/blob/main/js/README.md#bundle |
@dsherret Thanks for clarifying major points like Deno compile (and the eszip link), and no planned support for deno pack. What you said about esbuild totally makes sense, and is exactly the kind of conversation I would hope to have. With that in mind, I still think it is critical to address "what happened to Deno pack". And to clarify what I'm asking about is: I wouldn't close an issue, treat the issue as a "wontfix", and not leave a comment. Wontfix is necessary part of software, I don't have a problem with that. But if I am going to treat something as wontfix, I explain my reasoning before closing it, and make it clear that I'm closing-without-fixing (not just closing and waiting till the next release and then let people figure out it was wontfix). If you addressed this and I missed it, I apologize for that. But it was the first thing on my critical-to-address list and to me it seems like it was missed. And just to be super clear, my question is; why was it closed as wontfix without a comment saying/explaining that? Going back to the full discussion. 1. Why I consider it removal
@dsherret I'm glad you bring this up, as it connects with the lack of detail in the 1.31 announcement. Defintions of "removed" aside, normally I wouldn't be concerned about a feature going from 1st party support (e.g. deno binary/builtins) to 2nd party support (e.g. deno std modules). Why? Because I have confidence in the deno team that 2nd party modules are well maintained/reviewed, and that old versions of std modules work with new versions of deno without fail. If anything I generally believe "if it could moved from core to std, it probably should be moved from core to std". So, for Deno bundle, why would I be defensive about moving it out of the binary? Well I'm concerned precisely because of the 1.31 announcement. My TLDR of the announcement is "maintaining the bundler is hard, and we don't think that feature is important, so we're dumping what we have at the moment into a 3rd party module". I say 3rd party because it's not part of the std library (which I believe was done because, again, the whole point is to not waste effort maintaining it). 2. The 1.31 AnnouncementIf the announcement said "its deprecated because we feel like it" I wouldn't be able to criticize that from a logic/soundess standpoint. I might be sad/annoyed, but the team would've been fully transparent and their reasoning would be sound. However, if the 1.31 announcement is the justification, then I think clarification is needed because the reasoning (or implied reasoning) doesn't make sense.
|
Probably wise given this is a free and open source project. Deno ain't exactly Oracle here. ;) IMO there's clear indication from the deno team this won't be supported; it's in the first comment that Ryan started this issue with. I would rather not take up any more time from the deno team on this and let them focus on building actual deno capabilities and fixing bugs rather than tending to these long winded and legalistic meta conversations. |
@jeff-hykin I just want to say, one Deno user/developer to another, that everything you wrote makes a lot of sense to me. I was making enthusiastic use of Deno.emit and then "deno bundle," and I followed all the release notes, and read the issue threads, and I saw the writing on the wall (that this functionality was essentially being abandoned), but I don't feel like there was direct and understandable communication about this. Deno_emit has been receiving some commits, but at release it was non-functional and untested. Overall it doesn't seem like something to rely on. I actually did think--somewhere in my head, until the latest messages here, or until very recently--that "deno compile" used this functionality, so it was in Deno somewhere, and that "deno pack" was coming at some point. The funny thing to me is that "deno bundle" is actually a fantastic replacement for a bundler, if you are just trying to bundle code. Just as Deno's way of doing modules replaces NPM without doing all the things NPM can do. I imagine Deno's early adopters include a lot of people who greatly dislike the complexity and fragility of NPM. So to me, embracing NPM is connected to this shift because it takes a ton of resources and also represents a philosophical shift towards being more entangled with the complexity of the rest of the JS ecosystem in order to be more popular. At the end of the day, though, the Deno team gets to choose their focus and scope. The total scope is very large, let's be clear. It's not like Deno is trying to keep a narrow focus and this wouldn't fit with that. It's just something to shave off rather than maintain, I think, because you have to cut scope somewhere. |
Actually that's why I waited a few days to respond. I don't want to make a mountain out of a mole hill, and it's easy to question myself with "what do I hope to accomplish by responding?" The answer is; I hope to learn if the team made an honest oversight or is just surface-level responding. Just like someone eating my lunch without asking, bundle being removed is a small negligible event. The problem is if I ask someone why they ate my lunch without asking, and they just avoid my question and pretend nothing is wrong. Then I stop hanging out with that person. I invest a lot of time into writing Deno libraries because of the original philosophy, community, and respect. |
We're deprecating I hear the feedback that some people liked it - but it doesn't seem to outweigh the problems. There are other solutions - esbuild, deno_emit, eszip. |
So (final question/input from me) deprecating it was not primarily because of nodeJS/commonJS support? @ry |
Support of npm has further complicated the situation. It's not possible for a relatively simple |
Just some added context that this issue was created over a year before npm support landed in Deno and about half a year before discussions about npm support became serious. |
Thanks @ry it means a lot to me to have you answer directly.
Yeah don't worry I was in the thread back then too 😁 I just didn't know if node was the core reason this was re-evaulated with a different conclusion. Thanks to the input here though, I feel confident I can paint a full picture now and lay this issue to rest for good. Even better I think it can give people like you @dgreensp and me a good deal of comfort. |
R.I.P.
|
I'm not mad, I'm just dissappointed |
For those looking for a copy+paste solution for bundling for the browser, here is what I've been using: 1. Create a new file:
|
You could try: sergeant (The microfrontends bundler for deno) https://github.com/scriptmaster/sergeant -or-
|
My one line for replacing deno bundle and transpiling typescript. (Not for web).
Not sure if --platform arg is necessary. |
Can anyone explain to me, (no provocation intended), why Bun is doubling down on a new bundler which seems to improve every release, and Deno is deprecating it? |
@GerbenRampaart the We do still have our eyes on providing an out-of-the-box general purpose bundler, and we did some exploration on using https://rolldown.rs/ or https://rspack.dev/, but it's not something that will happen for Deno 2.0 release. Maybe in Deno 2.1 or later. |
I found |
It kinda got lost in the conversation @jflatow , but I've been maintaining deno_bundle as a drop-in replacement for ~1.5 years now. I'd love you have your help! And hopefully it'll save you some effort too. I just recently added |
JS bundlers have a lot of complexity and we do not want to take on all that complexity in Deno. We believe this can be done effectively in "user space" - that is, it doesn't need to be built into the Deno executable. Packup is an example of a Deno program which utilizes esbuild-wasm to provide complex bundling abilities.
Ultimately we'd like to remove swc_bundler dependency completely completely from Deno.
The text was updated successfully, but these errors were encountered: