简体   繁体   中英

Angular third party library components usage best practices advice request

I'm a junior developer and I've been developing a Angular 7 web portal where I use many other components from some libraries such as ag grid or ng lightning.

As I'm starting to use the same component in many pages, my question is in regards to major version updates from those libraries that can have many breaking changes.

What is the best practice approach to require the less work when updating the libraries? Should I have my own reusable components that act as a wrapper the library respective component, so I only need to change the implementation in a single place? Or is there a better option?

Thank you very much in advance, Ralms

It's kinda situational. If you're going to have multiple components that contain ag-grid or ng-lightning, then building a wrapper might make sense. If you're only using them once or twice and they don't share much commonality, it probably doesn't need a wrapper. Also, you can just choose to not take an update.

I'd suggest just leaving them as is, but if you reach a point where you think "it sure would be nice if all the xx-yyyyy components had a wrapper"... make it so.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM