I took the time to upgrade strve.js last week, and the current version is 2.3.3. Interested friends can go to the official documents. Speaking of official documents, a friend of mine said earlier that my documents lacked a visual interface, like an online editing plugin. The friend’s suggestion was good, so I did some research on the Internet and finally settled on Codepen. The reason I chose it is because I’m just presenting it on a separate page, so it’s simple enough.

Second, there are two recent updates in succession: 2.3.3 and 2.3.2. Let’s take a look at the update logs for these two releases.

v2.3.3

  • StrveAPI parameter adjustment;

v2.3.2

  • HTML tag content can be displayed in non-string type.
  • Data binding is used uniformlyThe ${}Symbol binding is no longer supported{}Symbols;
  • View templates support multiple root nodes;
  • View templates support Text nodes;
  • [Fixed] Unable to render nodes correctly when switching state during conditional rendering
  • increasewatchDOMChangeAPI for monitoring DOM tree changes;
  • Added support for HTML template string highlighting (VSCode editor to be installedes6-string-htmlThe plug-in);
  • deleteStrveThe APIdataAttribute parameter;
  • View templates support Class writing;

This change is also quite big, mainly internal overall optimization.

For example, I learned from the internal ideas of Vue’s V-IF instruction to achieve conditional rendering and use annotation nodes to achieve DOM placeholder, which I think is worth learning.

However, there is a problem with the virtual DOM scale, because strve.js is internally similar to react. js in that it calculates the Diff of old and new data after data changes. In order to break performance bottlenecks, React.js uses the concept of operating system time sharding to introduce Fiber architecture. In layman’s terms, we microcosm the entire virtual DOM tree, turning it into a linked list, and then we use the browser’s free time to calculate the Diff. As soon as the browser needs it, we can set aside unfinished tasks, give the browser control back to the main process, and wait for the next time the browser is idle.

However, I believe that the problem will be solved gradually in the future. When we talked about React. Js above, we used to write JSX in the Class. Well, strve.js is fine.

There are many other highlights of the strve.js upgrade. You can open the optimized official document to view it. There are two options (copy the following address to your browser).

1. (Chinese official document)

Maomincoding. Making. IO/strvejs – doc…

2. (Domestic sites)

www.maomin.club/site/strvej…

There won’t be a major update to Strve.js for a while, so I want to take a break and focus on my other studies. However, if you have any suggestions, please make an issue on Github or contact me directly.

Making address:

Github.com/maomincodin…

End of article, thanks for reading!