Hmm, pretty heavy use of ES6, too (async/await, decorators etc.). Is there any "modern" library left that lets you use the browser's JavaScript engine directly, without transpiling?
Glimmer – Fast and light-weight UI components
61–70 of 133 posts
Re: Glimmer – Fast and light-weight UI components
#62Whoa, good. I was worried, 12h passed without major new JS framework on the front page. But, clock started ticking again..
Maybe you should read about it a bit before you dismiss it with useless snark. This is not a new JS framework. This is the view layer extracted from Ember as a standalone library.
Re: Glimmer – Fast and light-weight UI components
#63Glimmer is smaller and faster than React, with TypeScript supported natively. This is a game-changer for people who are looking for a lightweight rendering library that ships with great tooling support and a larger framework ecosystem behind it.
What are their respective sizes? Could you link to some benchmarks? I wonder how it'll stack up to React Fiber. I love when libraries compete on performance, since it can end up benefiting everyone.
React Fiber is currently just over 70k, and that's just the reconciler, not the complete React package. However, according to Dan Abramov[0] they have not yet focused on optimizing the bundle size either. And Fiber includes some prioritization features that we don't have in Glimmer yet.
Re: Glimmer – Fast and light-weight UI components
#64Did not find easily any live example, should be required for any "UI" library. And should be displayed on the frontpage
The API docs themselves are a Glimmer app: https://glimmerjs.com/api/ . The source code is here: https://github.com/glimmerjs/glimmer-api-docs You may also enjoy the prerequisite turbo-stress-test app: https://glimmerjs.com/demos/uptime-boxes/ https://github.com/glimmerjs/glimmer-demos
uptime-boxes suffers from the same problems as the original dbmon - the tree is static and the diffing engine has little to do while the DOM mutations are only nodeValue/textContent and className.
Re: Glimmer – Fast and light-weight UI components
#65But what I came to say is I think templating languages are sub par. Using an actual programming language that returns "html", or some variant (like clojurescripts hiccup language) is way more useful. I wouldn't use this because of that.
Re: Glimmer – Fast and light-weight UI components
#66> Glimmer compiles your templates into low-level code so it can run as fast as possible—without sacrificing ease of use. What's the benefit vs just writing your templates in JavaScript in the first place?
JSX vs. templates is a common debate, with popular JSX options like React and Preact and template-based options like Vue and Glimmer. The reality is that there are hard tradeoffs to both and anyone who tells you one is obviously superior to the other is probably trying to sell you something. For me personally, templates ever-so-slightly edge out tools like JSX. For one, I subscribe to the Rule of Least Power[0]. Havi…
As for mapping JSX to HTML I think React's biggest strength is it's composability. But it comes with a price: things start to smell very, very quickly unless you religiously separate concerns.
Re: Glimmer – Fast and light-weight UI components
#67Earlier quoted context omitted.
Maybe you should read about it a bit before you dismiss it with useless snark. This is not a new JS framework. This is the view layer extracted from Ember as a standalone library.
Ah, thanks for explaining that ! I thought the Ember team had started an entirely new project instead of reusing something that already existed. If they extracted it, that makes much more sense to me now.
I see it on HN all the time, like a celebration for not having to read the submission. "Phew, that was a close one!"
There are maybe 8 sentences of copy on that landing page. One of them is:
> Because Glimmer powers the components in Ember,
> there’s a battle-tested, full-stack framework
> waiting for you—if you need it.Re: Glimmer – Fast and light-weight UI components
#68Close to the metal: Glimmer is one of the fastest DOM rendering engines, delivering exceptional performance for initial renders as well as updates. Architected like a virtual machine (VM), Glimmer compiles your templates into low-level code so it can run as fast as possible—without sacrificing ease of use. By low-level code, they mean… JavaScript, right? In what sense is this "close to the metal"?
Re: Glimmer – Fast and light-weight UI components
#69Hmm, pretty heavy use of ES6, too (async/await, decorators etc.). Is there any "modern" library left that lets you use the browser's JavaScript engine directly, without transpiling?
Almost all major browsers support ES2015. A few recent versions support async/await, now that it's expected for that syntax to be a part of ES2017. None support decorators (in fact, I'd be surprised if decorators ever make it into the formal ES spec).
Re: Glimmer – Fast and light-weight UI components
#70Close to the metal: Glimmer is one of the fastest DOM rendering engines, delivering exceptional performance for initial renders as well as updates. Architected like a virtual machine (VM), Glimmer compiles your templates into low-level code so it can run as fast as possible—without sacrificing ease of use. By low-level code, they mean… JavaScript, right? In what sense is this "close to the metal"?
No, they are compiling it down to instructions which are then interpreted by the Ember/Glimmer VM: https://youtu.be/vg5A_UOGShg?t=42m8s