Hacker Newsnew | past | comments | ask | show | jobs | submit | mtschopp's commentslogin

Could it be related to a Log4j issue?


CircleCI has problems downloading npm packages either


It's because jQuery is a library on top of JavaScript. That makes it slower than native JavaScript.

If you don't need to support very old browsers you can easy go without jQuery.

Have a look at http://youmightnotneedjquery.com


You cannot really compare a React project with a non-React project if it is done by different people.

We use React since four months, and we develop faster compared to before, when we used only jQuery.


Was that because you now structure you code in a better way, or was it because of React's functionality? And what aspect of the functionality was the most productive? The templating system? Did you used to hand-code your HTML in jQuery, or did you use templates in the HTML document?

(Genuine questions, not making a point).


A bit of both. With React we now have a much nicer code structure, because it forces us to think in components. We have a JS file and an SCSS file for each component. Before we rendered the view on the server side with Python/Jinja2.

I think there are many reasons for the productivity boost. Thinking in components, more readable code, great debugging possibilities, understandable data flow, to name a few.

And, last but not least, it is lots of fun :-).


That's right, Flux is not that easy to understand. We use Reflux for the sake of it's simplicity. Here is a good comparison of Flux and Reflux: https://www.amberbit.com/blog/2015/7/14/flux_vs_reflux/


Why is React only for the enthusiasts? Big corps like Netflix and Atlassian use it in production.


Nice to see some effort in this area. How is it compatible with the flux architecure?


It works very well! React Resolver is handling the async-loading & rendering problem for you. How you choose to fetch & update data within your components is up to you :)

I have a very large application in production now using a custom flux implementation (since the flux wars have finally died down Alt & Redux taking the lead).

There'll be some documentation & examples around Redux specifically, but the gist is you'd do something like this (not using any Flux library in particular here):

  // Flux - watch UserStore for changes & provide "props.userStore".
  @connectToStore(UserStore)
  // Flux - provide actions as props for the resolver or component to use.
  @bindActions(function(dispatcher) {
    return {
      create: dispatcher.actions.User.create,
      save: dispatcher.actions.User.save,
    };
  })
  // Resolver - 
  @resolve("user", function({ create, userStore }) {
    return userStore.getCurrent() || create("New User");
  })
  // Now your component always has the latest, updated user
  export default UserProfile extends React Component {
  
Watch the repo for some more examples, as there'll be both Alt & Redux examples.


Seems incompatible to me. You don't fetch data inside the components when you're using Flux.


It's compatible, as this is live in production today with a Flux library, and there are Alt & Redux examples in the works.

How you choose to fetch data is up to you, whether you use Flux, or fire AJAX calls within the `@resolve` function.

That's your code, not mine. I just make it so you can put your data requirements _beside_ your component instead of several layers up :)


but isn't the plan with Relay to do just that? or not?


You're correct in that Relay correctly identified the same architectural problem with having data requirements _far away_ from the components that actually need it.

This is why React Resolver was created, and from what I've seen, also spurred React Nexus & React Transmit as well.

On an related note, v1 of React Resolver explicitly stated how it was similar to Relay with regards to fetching data for components. I've since dropped that messaging to avoid confusion since Relay isn't even available yet :)


Nice idea. Would be cool if an element's background-color changes for a second whenever it has been rerendered.


I also thought about making it have the elements background-color or some other attribute animate from teal to gray over time so new nodes would be brighter. I haven't had a chance to try it but it would be really cool to see visually how many DOM nodes are getting completely rerendered (in other words, how well one is using React).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: