current position:Home>Weekly sharing (issue 141)

Weekly sharing (issue 141)

2021-08-27 04:56:06 Ali intelligent marketing platform front end

Journalism 、 Point of view 、 Interesting

stay Vue2 Project use @vue/composition-api
Maybe a lot of people will ask , Why must it be in vue2 Upper use composition-api Well ? Upgrade the project directly to vue3 No, that's good ?

Ecological problems , Many open source libraries are currently being upgraded to vue3 If the project is very large, start vue2 -> vue3 The migration of is still very troublesome . stay vue2 Use composition-api Will not affect existing functions , And if you want to upgrade to vue3 Then you just need to import the package from @vue/composition-api Change it to vue That's all right.

A sufficient article TypeScript summary

Readability and maintainability of code : Take up a ? Look at the return value of an interface at the back end , Generally need to go to network see or Look at the interface documentation , Just know the return data structure , And used it correctly ts after , The editor will remind the interface of the type of return value , This is quite practical . Most errors are found during the compilation phase , Avoid a lot of online bug Enhanced editor and IDE The function of , Including code completion 、 Interface tips 、 Jump to definition 、 Reconstruction, etc

Google New front end framework for Lit
Google New framework for Lit ,Lit It's based on Web-Component Build a front-end framework , The predecessor can basically be understood as Polymer. because Lit The framework is still in iteration , Some of the code implementations described in this article are likely to have been refactored , Interested students , You can turn it over Lit Source code .

『 Interview confidence 』—— Release of design patterns - A subscription model ( Two )|8 Yuegengwen challenge
First of all, we need to specify who will be the publisher ( Experience shop );

Then add a cache list to the publisher ( Experience store book ), Used to store callback functions to notify subscribers ;

At the end of the day , The publisher will traverse the cache list , Trigger the subscriber callback function stored in it in turn ( Ergodic book , Text one by one ).

Vue Source code —— How templates and data are rendered into the final DOM
Why do you ask in an interview Vue Source code , Many people generally this question ,Vue Source code is rarely used in ordinary work , and Vue Of API It is often used in work . Will use Vue Of API If you don't, you can meet the needs of the job . This is not an interview to build a rocket , Work screw . Actually, I don't really want to ask you Vue Source code , Only by means of Vue Source code to assess your JavaScript Is the foundation solid , such as JS Operating mechanism 、 Scope 、 Closure 、 Prototype chain 、 recursive 、 The mastery of knowledge such as coritization . So as to distinguish the ability level of the interviewer . Therefore, it is essential to master the source code of a framework in the interview of senior front-end Engineers

course 、 skill

How to delete... From a large code warehouse 6w Line obsolete files and exports?
Many projects have a long history , Many of them Documents or export Out variables No longer in use , Very much affects maintenance iterations .

copyright notice
author[Ali intelligent marketing platform front end],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2021/08/20210827045603703A.html

Random recommended