Hi Everyone - author here. I just wanted to give you some background on the project. JohnnyDepp came out of a feature request I got on another project called LoadJS (https://github.com/muicss/loadjs) which is an async loading library. The request was for a higher-level dependency manager that:
1. lazy-loads files
2. handles JS/CSS/images
3. handles nested dependencies
4. makes it easy to manage dependencies among team members
5. is extremely lightweight
I realize that many teams use RequireJS to manage dependencies but I saw an opportunity to make a library that could accomplish many of the same things but with a much smaller footprint and a simpler API. I hope you'll give it a try and let me know what you think!
Thanks for the recommendation! I wasn't aware of the modules feature or that it was already supported in Chrome/Safari/Firefox/Edge. I'll take a closer look at modules but if you're only targeting edge browsers then maybe you can do dependency management purely natively.
Maybe you should name this JohnnyDep so it's more an allusion and less the actual person's name? Dep makes more sense anyways, as dependency has one p.
Or perhaps `JonnyDep` or `JonnyDeps`. A whimsical allusion to someone else can be playful and respectful.
But to appropriate someone else's full exact name for another purpose is kind of rude – especially if that person makes their living from their public image/name.
The web as a "document only" medium is long gone. However where I would slightly agree with you is new sites that could have a simple interface loading tonnes of JS. But for business apps delivered over the web, yes we need tooling to tame JS.
Please no. Write standard modules. Serve standard modules to modern browsers, optionally bundling to modules for production. Bundle to non-modules for legacy browsers.
Then we can all eventually move forward from this mess of non-standard module formats and loaders.
They’re still mainly bundlers for now, such as webpack. But browsers are slowly adopting first class modules which has already been solidified by the spec afaik.
Probably using the ES2015 import syntax[1], which allows you to dynamically load modules. I have my doubts whether your average medium+ sized JS app will be that dynamically, so you'll probably end up slurping a whole lot o' module at startup. And without tree-shaking, more stuff to download and digest.
You can bundle modules together so you don't have a ton of downloads, but the basic module graph will at least be loadable. WebPackaging will also help in the future.
One thing that really sours me in esm is that this is possible (fictional main.js):
import Vue from 'vue'
import jQuery from 'jquery'
global.jQuery = jQuery // to get the next line to
work
import Bootstrap from 'bootstrap'
import 'bootstrap/dist/css/bootstrap.css'
Then my head explodes. Why would importing a .css file from my JavaScript ever be a thing supported by any tooling. What is that line trying to communicate? What does it even mean to my current scope? (hint: nothing)
import became a giant "do something cool on this line" that maybe the tooling you're using knows how to translate via (say) a webpack loader.
For anyone wondering, that line gets translated to the browser dynamically including css on the page.
It's fine to raise a concern or ask a question about it, but please don't be snarky about it. That's against the rules, both for Show HNs and for the site as a whole.
Responding to someone's work with "Please no" seems snarky to me. Certainly it's rude—especially in a Show HN thread, which is all about someone sharing their own work.
Sinatra's dead. Depp is a real, living actor and the value of his name directly affects his current net worth. Glorifying him, therefore, is different than doing the same for Sinatra.
44 comments
[ 2.7 ms ] story [ 76.9 ms ] threadWhen you use that, you have dependency management supported by the browser natively.
In that light, are custom dependency loaders still needed?
https://youtu.be/wv9PWo-KLc0
https://youtu.be/CAt5JB96Cdk
"Johnny"
But to appropriate someone else's full exact name for another purpose is kind of rude – especially if that person makes their living from their public image/name.
Then we can all eventually move forward from this mess of non-standard module formats and loaders.
The way I typically thought of dependencies with browsers was to bundle them all together. Is there some new solution to this problem?
[1]https://caniuse.com/#feat=es6-module-dynamic-import
import became a giant "do something cool on this line" that maybe the tooling you're using knows how to translate via (say) a webpack loader.
For anyone wondering, that line gets translated to the browser dynamically including css on the page.
https://news.ycombinator.com/showhn.html
https://news.ycombinator.com/newsguidelines.html
https://news.ycombinator.com/showhn.html
[0]: https://curiosity-driven.org/minimal-loader