Live data from Hacker News

Mern: Build JavaScript apps using React and Redux

mern.io

61–70 of 141 posts

Re: Mern: Build JavaScript apps using React and Redux

#61
post #39

Your demo needs fixing, it's open to XSS and that has been tried and tested, as expected for this crowd. :)

Oh yes, XSS attack on a bare minimum blog app! There's a reason why its called starter app!

Might as well just store credit card info and passwords in plain text while we're at it. Starter app! Disruption!

Re: Mern: Build JavaScript apps using React and Redux

#62
post #49

FRAMEWORK (shitty tragedy in one act) Dramatis Personae PROGRAMMER, programmer HIPSTER, hipster * * * ACT I Small room. There are a table with paper stacks, opened "Perrier" bottle, two huge monitors and a programmer sitting behind. Programmer reads papers, looks on first monitor, then on second and typing something. From time to time he says "damn idiots". Number of "damn idiots" is divided equally between papers, f…

I don't see the reason why would you apologise for your english when you use the words like 'Exeunt' ... Otherwise good joke.

Re: Mern: Build JavaScript apps using React and Redux

#63

I just don't understand the motivation for the cli. Isn't it much easier to just clone the mern boilerplate repo, rather than npm installing some cli, then running a command. If there are no options, what's the point? Admittedly, I might be missing something.

I think a cli tool is usually easier because you don't have to rm -rf .git in order to set up your own repo.

Re: Mern: Build JavaScript apps using React and Redux

#64
post #23
post #5

The page keeps mentioning 'isomorphic apps' but I have no idea what those are. From googling, they appear to be JS code that can run client and server-side? Not what I would have guessed!

An isomorphic app is basically a Single Page Application (think Angular / React / Ember application) with the special ability to be rendered server side. The interest vs a simple SPA is that on the first page load, instead of loading just javascript, and having to wait for XHR request and JavaScript rendering to draw the data, you get the page properly rendered in the first place. But when you navigate to go to a dif…

Also it's better from an SEO point of view, since depending on how you implement your SLA Google may be unable to read it.

Re: Mern: Build JavaScript apps using React and Redux

#65

FWIW 'isomorphic javascript' was pretty much supplanted by 'universal javascript' last year per this medium post [1]. You might consider changing the copy. Edit: At the very least Dan Abramov (Redux creator) is ok with universal [2] [1] https://medium.com/@mjackson/universal-javascript-4761051b7a... [2] https://github.com/gaearon/react-redux-universal-hot-example

Universal JavaScript is incorrect. There are more JS runtimes than Node and the Browser. Does React run in Postgres? In Duktape?

Re: Mern: Build JavaScript apps using React and Redux

#66
post #29

Earlier quoted context omitted.

It's one of those instances where developers went looking for a word that perfectly articulates what it's doing, but is so esoteric as to be useless. > being of identical or similar form, shape, or structure I call it fronty-backy-samey-samey and everyone knows what I'm talking about.

It's not really esoteric... it just kind of has the wrong connotations, because it's used rigorously in mathematics, and here it just means "portable between different JavaScript runtimes," pretty much. To me the word makes me imagine a web application that can parse its own rendered HTML and get back the application state. Which sounds kind of interesting...

It's not about runtimes. It's about environments. The difference between Node and Chrome isn't so much the runtime as that one is on the server (with arbitrary network and file I/O) and the other is a browser (with a DOM and Web APIs).

Isomorphic means that the same code can be used to "pre-render" an app on the server and to interactively run the app on the client, preferably without losing input state if the client-side execution is delayed (i.e. not throwing away the rendered content but attaching to it).

More generally it means that the code wraps any underlying APIs to make it behave similarly (but not necessarily identically) in node and the browser. Like isomorphic-fetch, which uses a polyfill (i.e. a fallback implementation in the absence of a native API) for the Fetch API in the browser or a node-based implementation in node.

The reason some people prefer the term isomorphic over universal is that isomorphic has no conflicting definition in the context of web apps. Universal on the other hand is extremely vague and ambiguous (ranging from "takes accessibility into account" to "works with different third party APIs" to "language independent").

The reason some people prefer the term universal over isomorphic is that isomorphic as a scientific term has unrelated meanings in mathematics, chemistry and other fields which can be domains for web apps.

Of course the real joke is that the definition is only about node and browsers, making no claim whatsoever about "all JS environments" or even "most". This is one of the reasons I personally don't like the term "universal": it implies a scope that simply isn't intended by most projects the term would be applied to. Something that only works in Edge and Node 5 might be "universal" but it isn't universal at all.

Re: Mern: Build JavaScript apps using React and Redux

#68
post #62
post #49

FRAMEWORK (shitty tragedy in one act) Dramatis Personae PROGRAMMER, programmer HIPSTER, hipster * * * ACT I Small room. There are a table with paper stacks, opened "Perrier" bottle, two huge monitors and a programmer sitting behind. Programmer reads papers, looks on first monitor, then on second and typing something. From time to time he says "damn idiots". Number of "damn idiots" is divided equally between papers, f…

I don't see the reason why would you apologise for your english when you use the words like 'Exeunt' ... Otherwise good joke.

I understand your point, but 'Exeunt' is Latin! :P

Re: Mern: Build JavaScript apps using React and Redux

#69
post #54

FWIW 'isomorphic javascript' was pretty much supplanted by 'universal javascript' last year per this medium post [1]. You might consider changing the copy. Edit: At the very least Dan Abramov (Redux creator) is ok with universal [2] [1] https://medium.com/@mjackson/universal-javascript-4761051b7a... [2] https://github.com/gaearon/react-redux-universal-hot-example

Lets not get caught in 'war of words'. There is no standard to it and I don't think it matters as long as you understand what it means.

> There are only two hard things in Computer Science: cache invalidation and naming things.

> -- Phil Karlton

Re: Mern: Build JavaScript apps using React and Redux

#70
post #31

Earlier quoted context omitted.

Not sanitizing input, by either scrubbing out any tags, or escaping those characterst to html entities.

Please don't "sanitize" input, just escape accordingly. " " might be a legitimate input.

You need both. Sometimes the legit input is HTML such as from rich text editors. In those cases if someone types a bold then the form should submit the escaped <script> but also needs to sanitise to make sure that other HTML element types are not present.

If you escape one step further you'll lose formatting or the message, so sanitisation is important too, it is reductive to say "always escape never sanitise".

Post reply on HN