Live data from Hacker News

Glimmer – Fast and light-weight UI components

glimmerjs.com

61–70 of 133 posts

Re: Glimmer – Fast and light-weight UI components

#62
post #51

Whoa, 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.

[deleted]

Re: Glimmer – Fast and light-weight UI components

#63

Glimmer 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.

The Glimmer runtime is under 30k, and we have not done much bundle optimization yet so hopefully this should go down a little bit even further.

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.

https://twitter.com/dan_abramov/status/844223224732958721

Re: Glimmer – Fast and light-weight UI components

#64
post #25
post #19

Did 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

do you guys have any benchmarks where the dom tree is not mostly static?

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

#65
I cut my teeth using Ember a few years back, the whole community is amazing and does great work. Using react/redux now, and while I think it's the simplest and most pragmatic approach (the connect function changed the game), I think the api's over in clojurescript land, specifically re-frame are the best . It's conceptually the same as react/redux, but with a few more facilities for isolating side effects in actions, and a wayyyyy simpler api for querying the store in functional components.

But 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
post #49

> 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…

I absolutely hate any sort of HTML directives or non-trivial templating which in my mind violate the RoLP. You have a fundamentally simple technology and you're shoehorning complexity into it with the end result being there are multiple ways to implement everything. In my mind I'd rather have one tool to do everything -- Javascript. I don't think of JSX as HTML, I think of it more like Elm does -- a way to structure your UI in code which just happens to compile to HTML.

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

#67
post #58

Earlier 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 don't understand these sorts of comments. "Heh, good thing you read and summarized TFA because I didn't and instead jumped to conclusions."

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

#68
post #31

Close 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

Re: Glimmer – Fast and light-weight UI components

#69
post #60

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?

Neither async/await nor decorators are part of ES6 (which is more properly called ES2015).

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

#70
post #68
post #31

Close 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

…which is written in JS. Everything's all relative though. JS is certainly a reasonable choice for this.
Post reply on HN