- Create React App 2 Quick Start Guide
- Brandon Richey
- 290字
- 2021-07-02 12:53:24
The early days of JavaScript development
To start, you need to dive back into the past of dealing with JavaScript code in the frontend. For a long time, you would end up with these JavaScript files that you'd just download off of a content delivery network (CDN) somewhere, throw into your frontend code, write a bunch of extra JavaScript code in front of that, and call it a day.
This was nice in the sense that you had your dependencies locked down to whatever version you downloaded and stuck on the server, and whatever you deployed was pretty easy to develop against because all of the dependencies were already there and ready to go. Unfortunately, it introduced a ton of problems in many other ways. For one, you would run into issues constantly where one of the libraries you downloaded was completely incompatible with a specific version of one of the specific versions of another library, and often that was a complex and difficult process. The way most people solved that problem was divided into a few camps:
- Going through and finding all of the incompatibilities and fixing them
- Writing complex glue code that would make the libraries behave together by wrapping one of the libraries and providing a means for the two libraries to work together
- Downloading a different version of the library just for another library and storing them separately, resulting in giant JavaScript bundles when you load the web page because you're probably downloading two to three different versions of something, such as jQuery