Why do you RequireJS?October 07, 2014
Yeah…well, I think I’m funny. (Sad Trombone)
<script> tags in the HTML. I don’t need to do any sort of checking or
onload event stuff, I just know it’s good to go.
Second reason: It defines a single point to start the application with the definition of the
Double “Ha”! What about your text file dependencies?
I don’t usually need it, but if I do there is a plugin.
Plus, if you’re using text files to localize your site, there is another plugin to help that that too.
When I start a project, I make sure I wire up RequireJS first before I start writing any code. Because:
- I don’t need to worry about libraries and other script not being loaded
- I know where my application will start every time the page loads
Ultimately, it gives me less things that could go wrong while I’m focusing on writing code. Plus, as a keep building the application, it forces me to think about what my “new” code needs to depend on as I go making it cleaner and easier for someone to get into.
Learn about it here. Given, it’s a steep learning curve with that documentation, but I guarantee it’s worth it.
Thanks for Playing. ~ DW