Hacker News new | ask | show | jobs
by elwayman02 3374 days ago
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.
6 comments

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

Is incremental rendering something that will be added to Ember/Glimmer?
It has it already. It had it for a while
Do you have a link to the docs for this? I cant seem to find it.
I think Glimmer/Ember have lost already. React is fast enough for most things and then there is Infernfo and Preact that are faster right now. If you mean a larger ecosystem as in number of libraries I would guess that the react ecosystem is 10x the size of Embers.
From my experience, the ecosystems are qualitatively different.

In Ember's, there's typically one community-sanctioned library that solves a particular problem, whereas React's tends to have more competing libraries. Like the frameworks, it's a tradeoff betw. customization and strong conventions. Doesn't make sense to compare based on number of libraries. Both approaches are valuable.

React-lite is 25kb, it gets there by stripping off proptypes and some other things without, sacrificing functionality, so it can always be applied as a production alias. Things like Preact and Inferno compat go even further, you can bring React down to 5kb or less. With React Fiber it will be easier to create modular packages that contain specifically what the app needs.

TS already supports JSX.

The install parameter you provide already requires yarn and the rather large ember-cli, in addition to requiring my app to be built on top of glimmer instead of with it.

How can this possibly be considered remotely lightweight, especially compared to something like Mithril? I count at least 12 repos on your github that seem to be integral components including a dedicated CLI!

A legitimate question!

One thing people really love about Ember is that the process for going from nothing to a working app is very streamlined. Typically, this is not the case with smaller component libraries. Personally, I think there's a market for opinionated tools on this side of the simplicity spectrum.

Another aspect of this is that more complex build tools can often do better analysis of your app and move more work to build time, improving the boot and/or runtime performance of your app. For me, I'll trade a longer npm install time if it leads to a better experience for users.

That said, all of the Glimmer packages are distributed as AMD, CommonJS and JavaScript modules on npm[0], with a `module` field and everything in their package.json. While it's not as turnkey as using Ember CLI, I hope people feel empowered to experiment with whatever their favorite build tools are.

[0]: https://www.npmjs.com/org/glimmer

You shouldn't be deploying a CLI into production. While I haven't looked closely at this particular system, guaranteed you are not deploying the CLI. Just using the CLI to create deployable code.

When people say "lightweight" they mean small sizes over the wire. The final size of the production/deployment code. Not the development code.

Those are only the build tools, and trust me you want a great build pipeline when dealing with Javascript these days!

In the screencast it shows that when you deploy you just get a javascript file for your components that should be super small.

Why is the size of the CLI a concern?
What I think the GP is saying, and I agree, is that the CLI makes Glimmer the center of your world and not just another library you use. MomentJS doesn't come with a CLI tool to use it. You just use it.
Did you try snabbdom? (https://github.com/snabbdom/snabbdom)

Works well for us :)

Polymer already fills that nieche I believe, except TS (it uses plain ES6).
Except for the lack of speed.

And the lack of great tooling.

And the lack of a large ecosystem.

And the insane data model.

I regret every moment I used Polymer.

- Lack of speed? - speed is equal to vue/react in dbmon benchmarks (even with polyfills).

- Tooling is quite good, polymer-cli, gulp, grunt support to name the most common stuff.

- https://www.webcomponents.org/elements - Thats a vibrant ecosystem :-) Big enterprises like ING, IBM, USAToday participate and release their components. (7k developers on slack channel)

- Insane data model? I work with my polymer elements same as I do with angular and react components. If in doubt just use redux/uniflow-polymer.

I get that you might not like it, but the issues you raised here are hardly valid (unless you used 0.5 or fresh 1.0)

Can you tell me anything in particular lacking in our tooling? I know we have a lot of issues open, and a long way to go, of course, but if there's something specific it'd be helpful.