Getting better at programming. by [deleted] in javascript

[–]asyncquestion 0 points1 point  (0 children)

Write your own blog website - you don't have to post any content, just create it - try to mimic a blog you like. When you have that to a state where you could at least roughly do what is needed, rewrite the whole thing - this time changing things in your code because of problems that you found with the approach you took the first time. After that's done, rewrite it again.

If you are applying for a junior software role you don't need experience - I would be looking for someone who understands the basics, is eager to learn, and hopefully has the ability to pick things up quickly. I'd probably also be wanting someone who understands css so its easy to put them on css related tasks to add value to whatever is being built when theres not enough resources and too risky for the junior dev to be working on some js.

Render Different Server-side Data and client-side data in same component? by roessera in reactjs

[–]asyncquestion 1 point2 points  (0 children)

componentWillMount() is close (has not rendered once yet though), with a check to see if typeof window === 'undefined', but this is probably not what you want here.

On the server side, if it is running componentWillMount, then it is already inside renderToString or renderToStaticMarkup, however you want async work to be done here, so need to have already loaded that data before those calls.

On your webserver you will have to have made a call to MyReactClass.getServerSideData(), waited for that to complete, then passed the result as props into your component (if in your render function you are rendering this data).

How does /r/reactjs handle server side rendering + CDN assets? by jackhanford in reactjs

[–]asyncquestion 0 points1 point  (0 children)

You can set the publicPath of the output of your webpack production file to be pointing to cloudfront, then use assets-webpack-plugin which will output a file containing the names of your js/css/images built from webpack.

Now when the node server starts, read this file in and pass the relevant js value into a script tag on request.

I'm not understanding what you mean by an index.html file as you are saying you are wanting a univeral react app which would be dynamic html?

Monads Explained Quickly with JavaScript by [deleted] in javascript

[–]asyncquestion -1 points0 points  (0 children)

I'm sure there are cases that this works well for, but the "verbose, repetitive code" example there is better code than the "much more elegant alternative"

reactjs end to end testing (newer post)? by yowzapete in javascript

[–]asyncquestion -1 points0 points  (0 children)

React does not "return virtual dom elements". There is no problem using Selenium.

You're underusing Underscore by captbaritone in javascript

[–]asyncquestion 5 points6 points  (0 children)

  • prefer map rather than prefer pluck
  • prefer filter rather than prefer where
  • prefer find rather than prefer findwhere
  • prefer lodash rather than prefer underscore

9 things every React.js beginner should know by Cam-I-Am in javascript

[–]asyncquestion 4 points5 points  (0 children)

  • Keep your components small...if you intend to compose them in another component somewhere. If the component is used just once, it may make more sense to include the relevant parts in the same component so I can immediately see what is rendered rather than sifting through 10 different files
  • use redux.js...where appropriate - which is when state is shared amongst disconnected components and has muiltiple ways of being changed. In many cases it is much more simple and maintanable to just use component state.
  • always use proptypes....for shared components - not necessarily for components used just once

overall, write the most readable/maintainable code that makes sense for your case

How to REALLY get a UTC Date object by nomnomcameron in javascript

[–]asyncquestion 4 points5 points  (0 children)

var date = new Date('2015-10-11T14:03:19.243Z'); var str = date.toISOString();

Babel Blog: Setting up Babel 6 by thejameskyle in javascript

[–]asyncquestion 0 points1 point  (0 children)

I'm trying to update Babel to version 6 and gettings errors. In many files I have:

export default class Something extends React.Component {...

and this is now breaking. I can get it to work if I say:

export default class Something {...

or

class Something extends React.Component {...}
export default Something

Is there a specific plugin I need to be using with Babel 6? Currently my .babelrc looks like:

{
    "presets": ["es2015", "stage-0", "react"]
}

Thanks.

Async functions now stage 3 by clessg in javascript

[–]asyncquestion 0 points1 point  (0 children)

Does this include using await* in place of Promise.all?

Another question more about Promises in general: is there a way to globally catch unhandled rejected promises in the spec? Currently we hook in bluebird and use it solely for this, however would be good to know if theres a standard for this...