Live data from Hacker News

Free React.js Fundamentals Course

courses.reactjsprogram.com

81–90 of 117 posts

Re: Free React.js Fundamentals Course

#81
post #46

Earlier quoted context omitted.

Why not socket.io for ajax calls?

I primarily use Django/Django Rest Framework as the back end so web-sockets are a pain right now. I'm looking forward to when Andrew Godwin's channel work gets into Django proper where socket.io would make a lot of sense. Unless I'm missing something and socket.io does ajax requests these days? I haven't used it in quite some time.

Have you looked into using something like Pushpin with Django? http://pushpin.org/about/

Re: Free React.js Fundamentals Course

#82

Earlier quoted context omitted.

No one mentioned code sharing between server side and the client side! (There are other ways to achieve this other frameworks/libraries are catching up) If you have a node.js server you can use react for both server side rendering and client side rendering.. So that you get the SS rendering advantages like fast initial page load and SEO but also have a very dynamic web app after the initial render.

Does server side rendering actually provide a boost in SEO these days? I know google renders JS apps (would be pretty silly of them to create angular if they didn't) and indexes SPAs, but am unsure on the other search engines.

No. Google and Bing can index JS apps just fine, however many social sites still don't pull the title/descriptions from dynamically generated pages when you click the sharing button.

Re: Free React.js Fundamentals Course

#83
post #30

Really can't decide to go ahead with an Angular approach (2.0) or use React. I know React is only for the view layer so what are people using with React to do stuff like api calls?

I'm a big Angular fan though I've done some React stuff as well. I think a reason to go with Angular 2 is the batteries-included approach (and TypeScript is cool once you get used to it, though certainly not required). With React you do end up having to hunt down libraries for everything beyond the view layer, which can mean a lot of random 3rd party libraries in various states of support. The flipside is the ecosystem is growing so could overcome those challenges and the architecture is simple and elegant. Honestly, I think ng2 is going to be really popular despite the backlash (and lack of HN representation) and so far the response I'm seeing is really positive once people dig in. I don't think you can go wrong with either though.

Re: Free React.js Fundamentals Course

#84
post #40
post #30

Really can't decide to go ahead with an Angular approach (2.0) or use React. I know React is only for the view layer so what are people using with React to do stuff like api calls?

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…

I've been hesitant of Fetch() because of the lack of timeout; has anyone been able to successfully get around this issue?

Re: Free React.js Fundamentals Course

#85
post #12

Honest noob question, what's with all the hype about React? Edit: Awesome replies, thank you!

From my point of view, React brings two important ideas to web app development: 1. The virtual DOM. When I'm writing jQuery-based code, I have to write both a component template and code that updates the DOM in response to input; when I'm writing code for a virtual DOM, the component template is sufficient to update the DOM and I don't have to write that extra code, so there are fewer chances for bugs to creep in. 2.…

> I didn't like this at first until I configured Sublime Text to highlight embedded HTML correctly

Can you share your sublime settings or syntax configuration you are using?

Re: Free React.js Fundamentals Course

#86
post #40

Earlier quoted context omitted.

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…

I've been hesitant of Fetch() because of the lack of timeout; has anyone been able to successfully get around this issue?

Yeah, this is an important question. I don't have answer for you and neither do the people in charge of the fetch API. It's an issue with promises not being cancelable. There's probably a reasonable argument that promises just aren't that great because you can only resolve or reject.

Personally I don't see a huge problem with either resolving or rejecting with a message about the cause of the result. Others see it differently but they haven't been able to make any progress on a major problem.

If you want to avoid this altogether there's no reason why you can't use a different library.

Re: Free React.js Fundamentals Course

#87
post #21

Just started learning js etc. Was told Angularjs has everything loaded so it's easy for beginners, while React is better for the more experienced who knows how to pull various things together? is this true? if so is there a "React-stack" for me to start with?

Angular is harder for beginners because it has everything loaded. React has fewer consepts. When learning & for non-complex apps, you don't even need flux etc. extra stuff.

http://jamesknelson.com/learn-raw-react-no-jsx-flux-es6-webp...

Re: Free React.js Fundamentals Course

#89

Earlier quoted context omitted.

From my point of view, React brings two important ideas to web app development: 1. The virtual DOM. When I'm writing jQuery-based code, I have to write both a component template and code that updates the DOM in response to input; when I'm writing code for a virtual DOM, the component template is sufficient to update the DOM and I don't have to write that extra code, so there are fewer chances for bugs to creep in. 2.…

> I didn't like this at first until I configured Sublime Text to highlight embedded HTML correctly Can you share your sublime settings or syntax configuration you are using?

I'm not the parent, but I wrote this [1] a year ago, and I think at least the first section still works for getting JSX syntax highlighting working.

[1]: http://petethompson.net/blog/js/2015/02/25/sublime-text-3-an...

Re: Free React.js Fundamentals Course

#90
post #30

Really can't decide to go ahead with an Angular approach (2.0) or use React. I know React is only for the view layer so what are people using with React to do stuff like api calls?

I'm a big Angular fan though I've done some React stuff as well. I think a reason to go with Angular 2 is the batteries-included approach (and TypeScript is cool once you get used to it, though certainly not required). With React you do end up having to hunt down libraries for everything beyond the view layer, which can mean a lot of random 3rd party libraries in various states of support. The flipside is the ecosyst…

> which can mean a lot of random 3rd party libraries in various states of support

I think this aspect makes Angular feel more like the "Java EE" of the web world. You can throw an Angular developer at an existing Angular code base and I'm fairly certain he'll know exactly what goes where and how things are strung together without much digging around or documentation required. For enterprises this is a very good thing.

Post reply on HN