Show HN: Nerv – A fast React alternative, compatible with IE8 and React 16
github.com
github.com
I've spent way too many hours of my life learning quirks of the horrible piece of garbage that is IE8. I don't think I hate any other piece of software as much.
If I had to support IE8 I'd instead try to make the site work without any JS. Anything even moderately complex would run horribly anyway.
At Social Amp (2012), I was making cross domain single-page applications for sites like 1-800-Flowers, where we had to support back to IE6, but, since a tag was missing from the main website, we had to do some hacks to "shore up" IE6 so the padding would be there.
It's feasible to have some pretty sweet JS (backbone.js, easyxdm) on IE6. The limitation came from the engine's performance, stylesheet and js caps, and really strict rules on, dangling commas (memory is a bit fuzzy in which instances, but it'd crash our whole script). In some cases, there'd be no errors, and it'd just freeze it.
[1] https://en.wikipedia.org/wiki/Internet_Explorer_box_model_bu...
Back in the day it was quite a PITA though.
Jesus... And I thought IE11 was bad (enterprise SaaS such as Salesforce is dropping its support already).
I’ve tried to run IE11 debugger on Virtualbox and it was slow as molasses.
The latter is somewhat difficult in an environment where IE8 is a factor (node as enterprise backend software is often a no-go).
I structured my site so that, in the worst case, the user has a plain old site of HTML + CSS and lots of hyperlinks that work just fine. My drop down headers default to pages that show the drop down content.
The embarrassing part was I had a simple bug affecting a sizable chunk of my user-base. In a certain browser, no code would run. But I never received a single complaint, because no one noticed. Sure, some fancy extras didn't work, but they are used to that with that particular browser. The information and required functionality was there. And I didn't have to write it in both PHP AND Javascript.
Son, let me tell you about Netscape 4...
I would'nt like to keep IE8 alive, sooner enterprises can't throw any more money at the problem, sooner we all get big paydays from the migration projects.
Opened an issue, hoping one of the authors chimes in and clarifies: https://github.com/NervJS/nerv/issues/10
Anybody up for trying?
(also: https://reactjs.org/blog/2017/12/15/improving-the-repository...)
makes me much more positive towards react - feels like there's some people taking the stuff quite seriously. Still not sure about the whole js idea, portable code that's unsigned etc - but things like this feels a little less... Cowboys and cool-aid than I'm used to from the js side of things.
Some discussion here that I missed: https://news.ycombinator.com/item?id=15339983
I can recommend several resources for understanding the changes in React 16:
- Lin Clark's fantastic ReactConf presentation on "A Cartoon Intro to Fiber": https://youtu.be/ZCuYPiUIONs
- The official announcements for React 16: https://reactjs.org/blog/2017/09/26/react-v16.0.html and https://code.facebook.com/posts/1716776591680069/react-16-a-...
- A good summary of the major changes: https://www.infoq.com/news/2017/05/react-fiber-closer-look
- Two articles looking at the user-facing features and changes: http://www.benmvp.com/slides/2017/reactboston/fiber.html#/ and https://www.robinwieruch.de/what-is-new-in-react-16/
That is an example of exactly why not - the support behind React is huge. Even if we take their word that Nerv is great from a technical perspective, it doesn't have the same level of community support.
Not that I am suggesting we ignore anything new just because it has a smaller community... just pointing out a downside that should be considered before using it on production projects.
I took a quick look at some of the earlier commits... and if there's any underlying React code there, then it's either been hand-written or hand-copied.
Another interesting bit: https://www.reddit.com/r/javascript/comments/7phc5q/a_fast_r...
It popularized the prefix/suffix algorithm used in most vdom libs today, and in addition, it's one of the only ones that use a LIS algorithm to further decrease the number of DOM changes in complex DOM reordering scenarios. Ivi also does a ton of other micro-optimizations.
Seeing that ivi was part of their research material tells me that this library's perf claims have a least some foundation to back them up.
Given that there is a reasonable number of Chinese PCs still on Windows XP, IE8 support makes sense.
Also understanding why it’s better vs Preact/etc would be useful. The readme is quite lacking on why it should be used other than it’s React compatible.
Seems clever though.
I mean China & India have more of those machines but... it's still a niche.
The Chinese README is still present in the current version published to NPM[1] which is v1.2.2
[0]: https://github.com/NervJS/nerv/commit/18b1d8720b69d250603d58...
Firefox console says "Reference error, event is not defined" when clicking on a tab.
onClick () { event.doSomething() }
vs onClick (e) { e.doSomething() }
The error isn't firing from the Nerv library, it's from their usage of it on the marketing site.[0] https://jd.com/
React and its 1 billion clones run off of the assumption that the DOM API is not to be trusted, and that lets you target more browsers, even non browsers. I mean have you ever tried to get Polymer stuff to work in Firefox? It's not Pretty.
That also speaks volumes about its approach, it just doesn't know what it wants. It's again based on weak, string-typed templates and is designed imperatively. After React, there's no time for this stuff anymore.
If you're only Polymer1, the only motivation to go to Polymer2 is performance. I suspect the same thing will be the case for Polymer3.
Why do you need to update?
const A = () => <div>hi</div>
const B = () => <A />
Polymer is everything but light, it is a huge abstraction. It ships a template engine parsing arbitrary syntax, emulates an arbitrary javascript accent, relies on dependency injection (in the above example it couldn't even refer to component A for instance).Being stuck with an old version that becomes unable to participate in its own eco system is no joke. It isn't just about performance. Imagine the implications for the community that builds parts, components and tools. Even if you deal with self-contained web-components, you'll still fetch two full versions of Polymer just to have them side by side. How insane is that?
And if they finally find a good balance, perhaps version 4 or 5, it has to compete against React eventually. And i doubt it'll look any less poor than it does right now.
In terms of weight, Polymer is less so because it uses less js code (the most expensive bytes for all parties), has fewer dependencies, and doesn't try and render server side.
As for ok'd versions: why is it impossible for a company or individual that needs it to maintain it themselves? Anyone using React or Angular also needs to do this.
React seems, to me, to be too big to fail. And the existence of Redux should show: it is far from perfect.
And if it's meant to be a React alternative, then I suppose it should support native as well.
While it may share a common history and core with ReactJS, React Native is really a separate beast. I realize it may be confusing due to the overlap in names. When people say React they are generally referring to https://reactjs.org and not the intersection it has with http://www.reactnative.com/ or the union of the two projects.
The official docs for React Native are at http://facebook.github.io/react-native/ by the way.
While React Native makes use of the react core package, it is a separate github project http://facebook.github.io/react-native/
React-native doesn't care on the other hand if the payload is 20kb smaller. Never seen a drop in replacement for it.