proj-oot-ootToReadsFrameworks

Microservice frameworks

" pmahoney 1 day ago

> Rating service having problems? Don't show user ratings. Search service offline for updates? Disable search

As an example of a (probably?) bad way to organize services, I worked on a project that had factored a role-based access control system into its own service. Every single web request hit this service, which made it a single point of failure, performance critical, impossible to temporarily disable, etc.

reply

shanemhansen 23 hours ago

One alternative to centralized role servers is to use client certificates. I've used x509 certs for this purpose. They are pretty hairy, but so is rolling your own authentication/authorization/token system.

reply

reubenbond 16 hours ago

Another alternative is JSON Web Tokens. Many of the benefits of Client Certificates while avoiding many of the hardships.

reply

"

useful related patterns:


frontend js frameworks

as of early 2015, jquery, angular, ember, react, backbone, knockout seem to be the frontrunners. underscore is a popular library (but some say Lodash is the new underscore).

jquery abstracts over older browser incompatibilities but is not a framework. it is large.

angular and ember are the frontend equivalent of 'full-stack' MVC. angular is more popular. angular 2.0 is coming. angular has more powerful abstractions (and is harder to grok). ember is more 'full-stack', and more opinionated. angular uses dirty checking to see what changed for the 2-way bindings. ember uses getters and setters and makes you wrap some objects. angular is slightly faster for rendering, and ember is faster for bindings (because they use observers rather than dirty checking). i cant tell which is better for low memory footprint; one blog mentioned in passing ember having probs with high memory.

backbone is models-only

knockout is 2-way data binding

react is view-only (almost; one-way model->view data binding)

http://todomvc.com/ is a great site

Doug made Classical, so it's probably awesome too and should be checked out.

some of these dont support old browers.

comparisons

http://sporto.github.io/blog/2013/04/12/comparison-angular-backbone-can-ember/ https://www.airpair.com/js/javascript-framework-comparison http://eviltrout.com/2013/06/15/ember-vs-angular.html http://ryantablada.com/post/why-i-chose-ember-js http://todomvc.com/ https://www.codeschool.com/blog/2014/05/15/angular-backbone-or-ember-which-is-best-for-your/ https://www.codementor.io/angularjs/tutorial/beginners-angular-ember-backbone https://www.codementor.io/angularjs/tutorial/beginners-angular-ember-backbone http://www.developereconomics.com/feature-comparison-of-4-popular-js-mv-frameworks/ https://www.codementor.io/javascript/tutorial/should-you-build-your-web-application-with-javascript-mvc-frameworks http://www.reddit.com/r/javascript/comments/25n7id/when_to_use_reactjs_and_when_to_use_angular/ https://muut.com/blog/technology/frameworkless-javascript.html http://blog.andyet.com/2014/08/13/opinionated-rundown-of-js-frameworks http://blog.durandal.io/2015/03/16/aurelia-and-angular-2-code-side-by-side/ about angular: https://news.ycombinator.com/item?id=9325501

benchmarks

http://matt-esch.github.io/mercury-perf/

" 1 runs average: { "Vue": 1333.0394889999989, "Backbone": 4249.259491000001, "Knockout": 2588.398652000007, "Ember": 6648.185466000003, "Angular": 3622.6095249999853, "React": 5269.383835999994, "Om": 2313.8796839999995, "Om v": 2493.4643030000007, "Ractive": 6514.763686999999, "Quiescent": 4957.199570999983, "Mercury": 1296.9315189999907, "Mercury (thunks)": 1458.206548000002, "Elm": 1042.5176520000095, "Mithril": 616.1811979999766, "Likely.js": 2104.198940000002 } See console output for more details. "

(lower is better; Mithril, Elm, Mercury, Likely.js, and Om were the fastest ones)

http://lhorie.github.io/mithril/benchmarks.html

looks like Mithril may not support server-side rendering?

https://github.com/lhorie/mithril.js/issues/60

https://www.google.com/search?client=ubuntu&channel=fs&q=mithril+server-side&ie=utf-8&oe=utf-8

StephanHoyer?/mithril-node-render · GitHub? https://github.com/StephanHoyer/mithril-node-render 6 days ago - Use mithril views to render server side.

" Stephan Hoyer • 2 months ago

Just did this for mithril. Was pretty easy though

https://gist.github.com/Stepha...

I'm really interested how the ember guys solve the model layer. This is in my opinion the most difficult part.

1 • Reply • Share › " -- http://emberjs.com/blog/2014/12/22/inside-fastboot-the-road-to-server-side-rendering.html#comment-1766401663

https://gist.github.com/StephanHoyer/bddccd9e159828867d2a

https://groups.google.com/forum/#!topic/mithriljs/wOCETdRvCXw

https://github.com/mrsweaters/mithril-rails

http://jonatan.nilsson.is/quick-start-guide-for-any-node-based-spa-with-mithril/

http://www.slant.co/topics/9/viewpoints/13/~what-are-the-best-client-side-javascript-mv-frameworks~mithril

https://groups.google.com/forum/#!topic/mithriljs/AyCO6XnB4lI

http://stackoverflow.com/questions/25983001/strategies-for-server-side-rendering-of-asynchronously-initialized-react-js-comp

server-side

java:

https://news.ycombinator.com/item?id=9278704


" Will React Hurt my Search Engine Optimization (SEO)?

React is significantly more SEO friendly than most JavaScript? MVC frameworks because it is based on a virtual DOM you can use it on the server without needing a headless browser on the server such as Phantom.js to render pages to search engine bots.

More specifically, React has the ability to render on the server side and transparently hook up its event handlers on the client, giving you the ability to handle both easily. If you call React.renderComponentToString on the server and then in the browser call React.renderComponent() on a node that already has this server-rendered markup, React will preserve it and only attach event handlers, allowing you to have a very performant first-load experience. "

this appeals to me not for SEO but for mobile...

see also https://www.codementor.io/javascript/tutorial/should-you-build-your-web-application-with-javascript-mvc-frameworks which suggests that Ember might help a bit? maybe only with the SEO tho..

---

react

tutorials:

Opinions:

Best practices:

Other:

iLoch 11 hours ago

Here's a look at the folder structure we're using for our app: https://i.imgur.com/wc7DyOA.png

/actions: Flux action creators

/components: These are all the JSX React components (the presentation layer) - so there are subfolders like "pages", "controls", etc.

/reducers: These are Redux reducers - they're the logic that handles all of the application state

/services: This is what your question was really about. We use basic ES6 modules for services, with methods like "fetchUser(id)" which use the new JS Fetch API behind the scenes. We then have redux-thunk and redux-promise middleware so we can easily offload state manipulation to these services without actually putting state logic in them.

I've set up a few React projects at this point and this always seems to keep a nice separation of logic. I'm never asking where data is coming from or where it's going. I think Redux has been the biggest difference maker when dealing with all of these parts.

It's no framework, but it's composed of well understood libraries, each with their own important function. You build the structure out yourself so you know exactly how it works, and the pattern will be very familiar to anyone who has used React before.

reply

also relay

also graphql (query language)

---

vue

http://blog.evanyou.me/2015/10/25/vuejs-re-introduction/ https://news.ycombinator.com/item?id=10455812

---

key words: progressive enhancement, server-side, isomorphic

https://www.google.com/search?client=ubuntu&channel=fs&q=server-side+ember+react&ie=utf-8&oe=utf-8 :

https://github.com/emberjs/ember.js/issues/9938

https://reactjsnews.com/isomorphic-javascript-with-react-node/

http://yanns.github.io/blog/2014/03/15/server-side-rendering-for-javascript-reactjs-framework/

http://berzniz.com/post/99158163051/isomorphic-javascript-angular-js-is-not-the

http://emberjs.com/blog/2015/01/08/inside-fastboot-faking-the-dom-in-node.html

http://ponyfoo.com/articles/server-first-apps

keyword for ember: "ember fastboot"

https://news.ycombinator.com/item?id=8786043

"

insin 68 days ago

I have form submission and redisplay with and without JavaScript? on the client working with my React forms library (newforms) and react-router.

The server version funnels POST bodies through the same willTransitionTo hook that the client uses for form submisson. Superagent is used within the hook to attempt submission to the same API route in both environments and redisplay is done by rendering a full page on the server, or emitting errors from the API via an EventEmitter? on the client, all with the same React component. User input, validation errors and any other data required to render the server version are made available for the client version to rehydrate from at any time it's able to.

There are still some bits which feel (and are) hacky, but it works - details here:

https://github.com/insin/newforms/issues/55#issuecomment-677... "

---

great slides:

https://docs.google.com/presentation/d/1afMLTCpRxhJpurQ97VBHCZkLbR1TEsRnd3yyxuSQ5YY/edit#slide=id.g380053cce_1763

React vs. Ember - Alex Matchneer - EmberNYC? meetup

some notes (some of these are quotes from the above):

https://github.com/omcljs/om

---

angular

react

flux+react

staltz 1 day ago

Redux is a major improvement over Flux libraries because it removes a lot of boilerplate while not removing functionality (in fact, enabling more features). In Flux libraries, it's common for an entity to take inputs and simply produce outputs. That's not the use case for a class. It's the use case for a function, and that's why Redux removes boilerplate.

However, I think it's time we stop calling everything Flux. Just because an architecture is unidirectional doesn't mean it's Flux. Facebook described it clearly as an architecture structured with: Dispatcher, Stores, Actions, Action Creators, and Components (sometimes even with the distinction of View and Controller View). Redux is Flux-inspired, but has significant differences. Maybe we should call it just Flux-inspired architecture. The distinction is important because there are other unidirectional data flow architectures such as in Elm (https://github.com/evancz/elm-architecture-tutorial) and Cycle.js (http://cycle.js.org). We might be creating confusion when mentioning "Flux" and meaning different things.

reply

vs angular

"

illicium 1 day ago

Hey, it has a cool name and it's made by Facebook. It must be state of the art tech, right?

Trolling aside, Flux really doesn't bring much to the table. It's trying to solve the pain caused by two-way-binding by forcing state to flow in one direction through an event bus, reinventing MVwhatever along the way.

You can already do this stuff in Angular (et al) if you stick to a few firm rules for how to structure your app.

reply

istorical 22 hours ago

Don't blame you if you don't have time nor motivation to respond, but care to share a 2 min. description of those rules?

I'm a fairly new developer working in my first post-uni role and we're starting to rack up a lot of Angular code and I'm not sure if I'm structuring things right as far as events vs $watches etc.

reply

illicium 16 hours ago

A few off the top of my head:

reply "

reflux

" andyl 1 day ago

Flux newbies should check out the Reflux implementation.

https://github.com/spoike/refluxjs

One of the best features is that Reflux lets you chain stores to eliminate WaitFor?.

reply

jbhatab 1 day ago

Also check out https://github.com/goatslacker/alt.

It's similar to reflux but in es6.

reply

"

term: "isomorphic"

" Isomorphic JavaScript? apps are JavaScript? applications that can run both client-side and server-side. The backend and frontend share the same code. " -- http://isomorphic.net/

riot

others

mithril

ampersand

vue

others

"

amelius 1 day ago

Let's be real. It's 2015 and we need quite some hoops to get, in most cases, some very simple data rendered on the screen. And even with all those hoops, we are still not sure that it works in all cases. Isn't it time for better tools than react? Like functional languages that support incremental computation?

reply

lukev 1 day ago

It's easy to speculate that better solutions are possible, but noone has ever actually done it. React (used from a more functional language, like ClojureScript?) is the closest system to the world you describe which actually exists.

And no, papers and toy proof-of-concepts don't count. They are extremely interesting, and a necessary first step, but someone needs to build something large and demonstrate effectiveness in the real world before you can make an honest bid for large-scale adoption. As far as I know, no other FRP or functional UI system has done any better than React on that front, yet.

reply

amelius 1 day ago

True. But consider this: if we had a functional-style language that did not do any incremental computation, only the minimal React-style of re-rendering, that would already be infinitely better. Because it would mean we wouldn't have to totally rewrite our code whenever incremental computation became a reality.

In other words, we can do it in steps.

reply

city41 1 day ago

I recommend checking out ClojureScript?. The community is really moving in this direction. I find cljs takes React from good to great (I wrote a simple blog post about that here [0]), and up and coming frameworks like reframe [1] are going to make it even better. reframe and even vanilla Reagent/Om/etc are heading in the direction you desire. ClojureScript? still has some warts to iron out, but all in all I feel like it's our current best bet for some truly amazing apps in the browser.

[0] -- http://www.mattgreer.org/articles/reagent-rocks/

[1] -- https://github.com/Day8/re-frame

reply

eric_bullington 1 day ago

parent flag

It's a good point. But don't mistake Flux, GraphQL?, cursors, etc. with React.

React is just a great, fast way to interact with the DOM, with much less hoops than usual.

I think the community is still converging toward the proper way to deal with state. First it was passing callbacks, then the Flux pattern, and now there's talk of how GraphQL? and Relay fit in.

And speaking of functional approaches, there are those of us who have been inspired by the Clojurescript community (who was in turn inspired by Haskell, as I understand it) and are interested in using cursors (similar to lens) to encapsulate state.

skybrian 1 day ago

If you're interested in this, perhaps try Elm? I'm not sure about performance, but it does enforce a pure architecture with all state outside the render tree.

reply

" susi22 1 day ago

parent flag

Has anybody in the client side community ever made the connection to rules engines? This flow of logic is awfully close to how a rule engine works. I wonder if people will at some point arrive at it.

There isn't a whole lot of rules engine in JS. Just nools [1] which is huge. I'd love to see a very simple forward chaining rule engine + Immutable + React and see how that would work out.

My guess is that they aren't popular at all because they have the notion of being enterprisey (Drools/Jboss). I'm a big fan of them. They /can/ make life & code very nice and elegant. Maybe somebody writes an JS adapter to clara rules [2].

[1] https://github.com/C2FO/nools

[2] https://github.com/rbrush/clara-rules " " -- https://news.ycombinator.com/item?id=9095991

" vmind 1 day ago

parent flag

Relay looks like it will partially replace Flux if you're using it to manage the client<->server state, but Flux still seems necessary if you have a lot of intra-client state to manage (such as in a document-editing SPA). " -- https://news.ycombinator.com/item?id=9097175

"

cssmoo 13 hours ago

Perhaps a huge coincidence but I pretty much wrote this framework in C# in 2004 (including rules engine) and was using it for mobile devices (wince/symbian). We abandoned it after 4 years for a simple CQRS system with event bus (before Udi/Greg went off on it or Fowler formalised it).

You know where we are now? Simple JSON REST API with local and remote queues per device updating a document store. All the queues have on receipt and on dispatch handlers attached and that is it. Each of these can modify the state or perform an external action.

YMMV but I'd probably start there first. It's much easier than the other two. I might write it up.

reply " -- https://news.ycombinator.com/item?id=9099524


d3


jquery


backend REST API frameworks


protobufish stuff

---

api design


other