Live data from Hacker News

Fusion.js: A Plugin-Based Universal Web Framework

eng.uber.com

41–50 of 79 posts

Re: Fusion.js: A Plugin-Based Universal Web Framework

#41
post #34

I'll use anything that the author of this article (Leo Horie) releases or is attached too. He is one of the greatest minds in JavaScript of this generation. After Angular, Vue and React I stumbled upon his framework Mithril.js and it was like I stumbled across the shroud of fucking turin, that framework is true poetry.

That's a funny analogy, the Shroud of Turin is one of civilization's biggest forgeries and hoaxes.

Re: Fusion.js: A Plugin-Based Universal Web Framework

#43
post #42
post #29

Earlier quoted context omitted.

Hi, that's me :) Fusion.js is a team effort though: https://fusionjs.com/team

How many full-time employees working on the framework?

All of the people in that page are full time employees and part of the Web Platform team at Uber. The only minor technicality is that Swojit is interning with us.

Re: Fusion.js: A Plugin-Based Universal Web Framework

#44
post #32

Earlier quoted context omitted.

Koa is an improvement over Express, but I think it would neat if the JavaScript ecosystem adopted an even more functional middleware style, like Python's WSGI, Ruby's Rack, Clojure's Ring, etc. Conceptually it's simple: middleware is a function that typically accepts a downstream "app", and returns a new "app" which accepts a "request" and returns a "response": const middleware = (app) => async (request) => { // do s…

Years ago, I played with the idea: https://github.com/danneu/klobb I went on to implement it in Swift ( https://github.com/danneu/hansel ) and then seriously improved on it in Kotlin ( https://github.com/danneu/kog ). It was fun but hard to really make a convincing upgrade to Koa once you consider the rest of the ecosystem. For example, since Koa exposes Node's req/res, then you can still use existing Node/Express mi…

I think it should be possible to write an adapter to use existing Express middleware. I haven't tried, but it's on my TODO list.

Re: Fusion.js: A Plugin-Based Universal Web Framework

#45
Looks awesome and love the focus on plugins. I also like some of the choices made, Redux, React Router, Security, etc. but going with Flow??

Our company has standardized on Typescript, it has practically "won". Unfortunately for me, introducing Flow would get shot down.

Re: Fusion.js: A Plugin-Based Universal Web Framework

#47
post #6

Seems to use Flow instead of Typescript. I wish MS and FB just merged their projects already. Really unnecessary friction when their syntax is 90% the same AFAICT.

But Typescript is a language on its own. It claims to be a superset of JavaScript, but includes JS features that aren’t even certain to end up in JS (decorators). And their import system... Whereas Flow is proper JS. It’s just so... nice!

Re: Fusion.js: A Plugin-Based Universal Web Framework

#48
post #46

Have any of the maintainers used Next.js? What was your opinion? What does Fusion.js do differently/better?

We did evaluate it. Some of the things off the top of my head that I think Fusion.js does better:

- isomorphic treeshaking

- more powerful bundle splitting (i.e. lazy loading can happen in any component rather than only at "page" level)

- async server-side rendering is composable via HOCs rather than only at top-level getInitialProps

- more things are provided by the team via plugins (e.g. I18N, CSRF protection, atomic CSS, async font loading, etc)

- better support for maintaining server-side complexity (e.g. by using Koa + DI system to make testing/mocking easier)

- out-of-band brotli level 11 compression for static assets

The team is about a dozen people now and we've been working on Fusion.js for over a year, so there's probably other stuff I'm forgetting right now :)

Re: Fusion.js: A Plugin-Based Universal Web Framework

#49
post #47
post #6

Seems to use Flow instead of Typescript. I wish MS and FB just merged their projects already. Really unnecessary friction when their syntax is 90% the same AFAICT.

But Typescript is a language on its own. It claims to be a superset of JavaScript, but includes JS features that aren’t even certain to end up in JS (decorators). And their import system... Whereas Flow is proper JS. It’s just so... nice!

That's not true. TypeScript spec is just the latest JavaScript spec. Decorators are a JavaScript (TC39 stage 2) proposal, and TypeScript only uses them if you use --experimentalDecorators. And TypeScript uses the ECMAScript module system. Whatever other features you think TypeScript has that aren't "proper JS" probably are either already JS, or are late-stage TC39 proposals.

Re: Fusion.js: A Plugin-Based Universal Web Framework

#50
post #26

Earlier quoted context omitted.

Yes. I wonder what's the future of Flow (even if it's still used and maintained). As I posted in another topic about TS: > It's kind of crazy that Facebook has let TypeScript takes so much market share. I've been using Flow for so long now. The techno is good, the integration with the code editors is good too, but Flow has a lot of small-but-really-annoying bugs (2235 issues on GitHub right now), the type definitions…

We chose Flow for a number of reasons. One of the main ones is type inference. For example: https://www.typescriptlang.org/play/#src=function%20a(x)%20%... https://flow.org/try/#0GYVwdgxgLglg9mABAQwBQA8CUiDeAoRRAJwFM... With Flow, we can surface type errors even in files that don't have any type information other than the @flow directive, e.g. http://eng.uber.com/wp-content/uploads/2018/07/image4.png

To me that's a feature and not a bug. A good codebase would have --noImplicitAny enabled, which would catch this. Relying on usage of a function to know its types is fragile, the function should be the one declaring the types it uses so that callers can adapt to changes, not the other way around.
Post reply on HN