javascript - How do you manage component dependency order with Facebook React? -
Say I have two react ingredients, A and B, where B depends on (uses) A Say A.J.J. in B. and B.J.S. Is
Is there any way to safely solve the dependency from B to A? Thus, it guarantees that in which order can I actually include a.js and b.js, although still be resolved correctly?
I believe the Google Closer Compiler effectively builds the dependency system for you in both your development and production mode. This order creates that the separate code source is irrelevant; Is there something like that to react?
Note: The response below is very old.
I stopped using the necessity a long time ago, because it is slow in development because there is no JS in the development in the file.
These days I
You can think of other bundles such as even more.By using this as a module system, in general JS, finally I'm planning to go completely ES-Module in the form of more bundlers with my first-class support, such as Rollup and WebPack 2 , Becomes mainstream.
Old Answer
For my knowledge, there is no dependency management system on itself; If you need one, then you should use some existing tools that fits in your workflow.
Personally, I am happy to do this with my module:
/ * * @ jsax React DOM * / / * jshint trailing: false, malfunctioning: false, newcaps: false * / define (function (required) {'strict use'; var react type = 'require' ('response'), _ = Requires 'Underscore'), JoinWidget = is required ('normal / view / join_width'); Var LoginWidget = React.createClass ({// ...}););
Every React view, as your other form of another class, forms your file.
It's okay in the development environment but I do not want to load the script at the output, so I use the hard-working js function to add files in the proper order so that they always have a Synchronous loads in the file.
Comments
Post a Comment