Over the past few years, function libraries have contributed a lot to the sudden popularity of JavaScript. JavaScript developers solve this problem. In addition, developers can develop solutions for problems they are interested in and apply these solutions to the business field.
I have been thinking about the future of the JavaScript function library, and I want the engine to be separated from the API.
Convenience of Selector Engine
There is a lot of debate over the speed of the function library selection engine, but the premise is that you have to use it. So what I call the selector engine refers to the customization based on my application: You can constantly change the selector Engine Based on your project.
Example: 1. Build a completely desktop web application-I want to use the selector engine as full as possible; 2, build a site version for the iPhone-I only need querySelectorAll because it can be supported; 3. Build a lightweight version that can be connected to a mobile device, I will use ID to limit JavaScript to the target element to keep it compact.
The selector engine has more and more options, especially when you know how to customize your application. What I want to see is: 1. Can we write plug-ins that import new engines into the database (such as jQuery, Prototype, and Mootools); 2, in the future, will mainstream function library versions support the pluggable query engine ). In short, developers can select the selector engine based on the specific needs of the application.
API Selection
Once the API and Selector engine are separated, the selection of function libraries is just a matter of personal interests. In addition, this separation allows more companies to create personalized function libraries based on existing engines or APIs. For example, the BBC created Glow-their own JavaScript function library because jQuery does not support Safari 1.
Challenges
Can the plug-ins of mainstream function libraries allow us to access the new selector engine in the function library? This is a challenge. I'm not Prototype or Mootools, so I don't know if it works. But it makes sense, doesn't it?