Live data from Hacker News

Mern: Build JavaScript apps using React and Redux

mern.io

31–40 of 141 posts

Re: Mern: Build JavaScript apps using React and Redux

#31

Earlier quoted context omitted.

As a curious noob, could u explain what is the source of the XSS vulnerability in this case? Is it simply that the site isn't being served over tls/ssl?

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.

Re: Mern: Build JavaScript apps using React and Redux

#32
post #27
post #19

Earlier quoted context omitted.

I use MongoDB because I can instantly save down a JavaScript object and later retrieve it in the same state. I don't have to worry about anything else. No configuration, nothing. That's all I need but if there are better options I'm all ears.

It's nice with zero configuration. Especially the no password by default thing. Why bother with limiting your database with host access and passwords ;)

I use environment variables so the configuration is basically setting up the host/username/pw in the Heroku interface. But ok, almost no configuration then...

Re: Mern: Build JavaScript apps using React and Redux

#33
So this is a repo that is being cloned on your computer [1]. I have a couple of questions :

1. Why not just creating yeoman generator?

2. Don't you think it is too opinionated and inflexible to be useful?

1: https://github.com/Hashnode/mern-cli/blob/master/lib/main.js

Re: Mern: Build JavaScript apps using React and Redux

#34

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

But isomorphic sounds cooler...

Re: Mern: Build JavaScript apps using React and Redux

#35
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!

Isomorphic means hybrid client/server view rendering.

SPAs are (relatively) slow to load. To improve perceived performance, the view requested is prerendered on the server with the ability to capture user input. The user sees a fully functioning site while the app bootstraps in the background.

Once the app is finished bootstrapping, the user inputs are replayed on the actual app.

This fixes the problem of poor perceived initial load times that come with SPAs. Once the app is bootstrapped everything is fast/snappy as one would expect with a SPA, incl no page refreshing between URIs.

Isomorphic React is already supported. Isomorphic Angular2 (ie Angular Universal) is in the works. I don't know about Ember but I'd assume they already support it.

Re: Mern: Build JavaScript apps using React and Redux

#36

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

Many people still don't agree, neither do I. There's no doubt that the term "universal" is more correct, however, languages don't work that way. In the JS land isomorphic has a very specific meaning. Universal is a flexible word. "A universal api for observables" means something (works across libraries), "An isomorphic api for observables" means something else (works across environments) .

Re: Mern: Build JavaScript apps using React and Redux

#37

Why MongoDB?

Because people hate the constraints put in place by SQL. It doesn't really matter that they'll spend dozens of hours re-implementing stuff they would've gotten for free with SQL in a RDBMS (not to mention the benefit of serious stability), what matters is that the initial effort to make a change is much lower, and thus developers feel like they're saving a lot of time/hassle. They don't seem to connect the cost on th…

With NoSQL you do have to reimplement all of the constraints in the application but this will likely be necessary even for SQL code because you'll need to provide both server and client side validations on user input.

SQL can be even more of a pain because you'll need additional checks to handle the SQL server's particular blend of error handling if/when something goes wrong.

In both SQL and NoSQL, any decent ORM should provide models, validations, sane error handling, and constraint checks so none of those really matter.

Unless, for whatever reason the business logic is defined in SQL SPROCS. Then, good luck if/when they don't work properly.

Re: Mern: Build JavaScript apps using React and Redux

#38
I'm not sure I like the trend of tethering an application to a specific backend, especially regarding databases. I think it would be more interesting to, if we're looking to be isomorphic, generate a front-end template and an API gateway . I say this because often when you're not working in tiny startups, your backend is handled by a different team and is loosely coupled.

Re: Mern: Build JavaScript apps using React and Redux

#40

I don't think isomorphic means what you think it means.

https://en.wikipedia.org/wiki/Linguistic_prescription

vs

https://en.wikipedia.org/wiki/Linguistic_description

You might dislike it but it's become common usage in the js community so by any reasonable non-prescriptive definition of 'means' it 'means' what this author says.

Post reply on HN