Re:Netflix: Removing client-side React.js improved performan...
by tomdale on Friday October 27, 2017 @12:39PM
(#15569984)
For folks who want to play around with this, we've got an interactive playground at https://try.glimmerjs.com/ that lets you add components, templates and helper functions.
In a nod to The Net, you can click the π symbol in the bottom right corner where you'll get a debug view of the disassembled binary bytecode.
Re:Netflix: Removing client-side React.js improved performan...
by jonkoops on Friday October 27, 2017 @10:07AM
(#15568370)
Tom Dale recently did a a great talk at ReactiveConf about Glimmer that I can highly recommend watching: https://youtu.be/62xd25kEZ3o?t=7h40m
Re:Netflix: Removing client-side React.js improved performan...
by alessioalex on Friday October 27, 2017 @10:39AM
(#15568775)
If I'm not mistaken Angular 2+ also has this. It's named AOT compilation (ahead of time).
Edit: so does Vue if you're using vueify (https://github.com/vuejs/vue/issues/4272).
Re:Netflix: Removing client-side React.js improved performan...
by christophilus on Friday October 27, 2017 @10:52AM
(#15568935)
It's not the same, though. Those are compiling textual templates into executable JavaScript. React/Preact do this automatically, too.
What Glimmer does is it converts your views into bytecode (not JavaScript) which can be streamed and run without a JavaScript compilation / parsing phase in the browser. Vue, React, and Angular views all ultimately are translated into JavaScript which has to be compiled / parsed in each browser.
Re:Netflix: Removing client-side React.js improved performan...
by 1_player on Friday October 27, 2017 @11:56AM
(#15569618)
I'll have a look at Glimmer later, but who executes this bytecode?
Re:Netflix: Removing client-side React.js improved performan...
by dean on Friday October 27, 2017 @12:06PM
(#15569703)
> They are instantly executable by a small VM written as a JS library
Guess you have download the VM on initial page load.
Re:Netflix: Removing client-side React.js improved performan...
by christophilus on Friday October 27, 2017 @02:04PM
(#15570774)
Yes. It's about 18KB of JavaScript.
Re:Netflix: Removing client-side React.js improved performan...
by keda on Friday October 27, 2017 @12:06PM
(#15569709)
glimmer-vm https://github.com/glimmerjs/glimmer-vm
Re:Netflix: Removing client-side React.js improved performan...
by irrational on Friday October 27, 2017 @01:28PM
(#15570450)
Is it more similar to Vue server-side rendering (https://vuejs.org/v2/guide/ssr.html)? Or are Glimmer and server-side rendering two different beasts?
Re:Netflix: Removing client-side React.js improved performan...
by christophilus on Friday October 27, 2017 @02:04PM
(#15570778)
Two different beasts.
Re:Netflix: Removing client-side React.js improved performan...
by bm1362 on Friday October 27, 2017 @10:34AM
(#15568705)
That's pretty exciting. I'm curious when we can just compile our views into some IR or byte code that can be natively run. Isn't that kinda what WASM is trying to do?
Re:Netflix: Removing client-side React.js improved performan...
by CyberDildonics on Friday October 27, 2017 @11:09AM
(#15569115)
Why use binary VM instructions with a VM written in JS instead of just straight binary data? Why does it even need to be instructions in the first place?
Re:Netflix: Removing client-side React.js improved performan...
by christophilus on Friday October 27, 2017 @11:35AM
(#15569398)
It needs to be instructions because the views aren't static. They are reactive. So some of the content is static, some might change due to user interaction. The VM understands this fundamentally and optimizes for that.
Re:Netflix: Removing client-side React.js improved performan...
by nerpderp83 on Friday October 27, 2017 @01:21PM
(#15570380)
hbar is no longer Planck's Constant but the speed a which a metacircular hypecycle can JIT itself on your runtime.
Re:Netflix: Removing client-side React.js improved performan...
by CyberDildonics on Friday October 27, 2017 @02:31PM
(#15570995)
I'm not clear on where the logic is needed. Even if there are cells or boxes that need to be a percentage of their parent and/or have min and max sizes etc, that can still just be binary data.
Re:Netflix: Removing client-side React.js improved performan...
by graphememes on Saturday October 28, 2017 @03:11AM
(#15574296)
Anyone thinking on betting on Ember, or Glimmer.
Word of advice / wisdom from having built multiple platforms / sites with it:
Don't.
Re:Netflix: Removing client-side React.js improved performan...
by zpr on Friday October 27, 2017 @10:10AM
(#15568413)
Glimmer itself is made by Ember?
Re:Netflix: Removing client-side React.js improved performan...
by juandazapata on Friday October 27, 2017 @10:20AM
(#15568533)
Yes, the ember core team is behind Glimmer you can use it today in Ember.
Re:Netflix: Removing client-side React.js improved performan...
by homero on Friday October 27, 2017 @10:05AM
(#15568356)
Wow that site loads instantly
Re:Netflix: Removing client-side React.js improved performan...
by bpicolo on Friday October 27, 2017 @11:20AM
(#15569243)
It's a tiny page of static html.
Re:Netflix: Removing client-side React.js improved performan...
by homero on Friday October 27, 2017 @12:26PM
(#15569873)
Oh I thought they're using their library
[dead]
Re:Netflix: Removing client-side React.js improved performan...
by christophilus on Friday October 27, 2017 @10:37AM
(#15568736)
If you can get all three of these-- good performance, simple application code, and a rich UI experience-- then yes, it's a win.
[dead]
It was enlightening. The size of your front-end application is generally dominated by view code. So, they precompile views into a super simple set of binary VM instructions (making your views very compact). These views don't go through the JS compile / parse phase on the client (saving hundreds of ms, up to seconds on slow devices). They are instantly executable by a small VM written as a JS library, and can be streamed in and rendered as they arrive (the way plain ol' HTML pages do). Turns out to be hella fast, but still gives the benefit of rich client-side rendering capabilities.
[0] https://glimmerjs.com/