" 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:
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.
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
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/
https://groups.google.com/forum/#!topic/mithriljs/AyCO6XnB4lI
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..
---
tutorials:
Opinions:
Best practices:
Other:
iLoch 11 hours ago
Here's a look at the folder structure we're using for our app: 
/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:
React vs. Ember - Alex Matchneer - EmberNYC? meetup
some notes (some of these are quotes from the above):