Live data from Hacker News

Glimmer – Fast and light-weight UI components

glimmerjs.com

41–50 of 133 posts

Re: Glimmer – Fast and light-weight UI components

#41
post #14

Earlier quoted context omitted.

I used Ember for about 2 years and thought so too. Now I'm using React and I think it's approach is much better. The API is tiny compared to Ember and there aren't much concepts, still it accomplishes everything Ember did. I feel bad to say this, but in the modular, library heavy, NPM based JS world of today, React (and other component frameworks like Cyclejs or hyperapp) fits just in. While Ember feels like a anachr…

Why would you want to build a bespoke React-based framework for every app you make? Why not simply have everything you need out of the box, plus the ability to easily integrate any npm library into your app via first-class build tooling that is miles easier to use than something clunky like Webpack?

I really don't, and few do, hence the popularity of create-react-app and next.js

Re: Glimmer – Fast and light-weight UI components

#42
I can't help but think: yet another front-end library. But Ember being solid, there is probably good reason for this project.

What does Glimmer do that all of the existing view libraries couldn't do ? x-tags, vue, react, preact, etc, etc, etc.

Wouldn't an abstraction layer on top of any of those libraries have avoided the need to create an entirely new project ?

Re: Glimmer – Fast and light-weight UI components

#43
post #42

I can't help but think: yet another front-end library. But Ember being solid, there is probably good reason for this project. What does Glimmer do that all of the existing view libraries couldn't do ? x-tags, vue, react, preact, etc, etc, etc. Wouldn't an abstraction layer on top of any of those libraries have avoided the need to create an entirely new project ?

I think the abundance of view libraries is evidence that no one has really "solved" it.

Re: Glimmer – Fast and light-weight UI components

#45
post #42

I can't help but think: yet another front-end library. But Ember being solid, there is probably good reason for this project. What does Glimmer do that all of the existing view libraries couldn't do ? x-tags, vue, react, preact, etc, etc, etc. Wouldn't an abstraction layer on top of any of those libraries have avoided the need to create an entirely new project ?

This is _the_ abstraction layer below an existing framework called Ember.js

Re: Glimmer – Fast and light-weight UI components

#46
post #42

I can't help but think: yet another front-end library. But Ember being solid, there is probably good reason for this project. What does Glimmer do that all of the existing view libraries couldn't do ? x-tags, vue, react, preact, etc, etc, etc. Wouldn't an abstraction layer on top of any of those libraries have avoided the need to create an entirely new project ?

an essential difference is compiling templates into compact opcodes instead of vanilla JS and effective rerenders

Re: Glimmer – Fast and light-weight UI components

#47
post #14

As a long time (5 years full time) Ember developer, this is quite interesting to me philosophically. I've spent a lot of time trying to tell people that all the stuff in Ember is there for a reason; for example, you're going to need a router, you're going to need support for controllers, etc. I still feel strongly that if your app is large and serious you are going to need that stuff. But. A lot of people just want t…

I used Ember for about 2 years and thought so too. Now I'm using React and I think it's approach is much better. The API is tiny compared to Ember and there aren't much concepts, still it accomplishes everything Ember did. I feel bad to say this, but in the modular, library heavy, NPM based JS world of today, React (and other component frameworks like Cyclejs or hyperapp) fits just in. While Ember feels like a anachr…

> still it accomplishes everything Ember did

That isn't really accurate unless you are adding additional libraries to accomplish all of the things Ember does. I'm not arguing with the rest of your post, just saying that statement is incorrect (in that it doesn't tell the entire story).

Re: Glimmer – Fast and light-weight UI components

#48

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

JavaScript takes time to parse and execute. My understanding is that the Glimmer solution reduces both parsing and execution time because it uses techniques that are highly optimized by the browser JavaScript engines, which makes it faster (sometimes significantly) than just using JavaScript templates. I also believe that's what is referred to when they use words like "low-level" and "close to the metal" in reference to what they are doing.

Re: Glimmer – Fast and light-weight UI components

#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]. Having the full expressiveness of JavaScript is very nice, but it makes it harder for tools to statically analyze and optimize the rendering process. Ember has gone through three major rendering engine architectures now (string-based, DOM-based and now the Glimmer VM) and the simplicity of the templating language has made that portability much easier.

[0]: https://www.w3.org/2001/tag/doc/leastPower.html

More importantly though, there are a lot of people in the world who know HTML and CSS. The fact that Glimmer templates are "just HTML" makes them accessible to people like designers who may not understand all of the fancy destructuring or array mapping happening in your JSX.

Lastly, and this is perhaps just a personal foible, but I have a really hard time mentally mapping more complicated JSX expressions into the final HTML output. It's fine when you're writing it, but reading it later, particularly to write CSS for it, is more challenging for me than Handlebars. I know some people would say that this is a code smell and that I should break that component up into smaller components, but I'd rather that decision be made by me than because I feel forced into it by the muddiness of my render() method.

Re: Glimmer – Fast and light-weight UI components

#50
post #12

For those that want to try it out, it looks like the released ember-cli version doesn't support it. To test it out, you can replace the first instruction on that page with: `yarn global add ember-cli/ember-cli` (edited for better command)

This is because we recently added the ability to specify a blueprint as an npm package, and it hasn't made it out of canary channel yet.

If you don't want to install canary Ember CLI, you can always just give it the longer git url:

ember new my-glimmer-app -b https://github.com/glimmerjs/glimmer-blueprint.git

Post reply on HN