To achieve backward compatibility, sometimes we have to write separate code for different π‘πΌπ±π²π·π versions.
This happens as a result of APIs getting deprecated and others emerging as their official replacements.
Fortunately, there are ways to handle this issue. Today I'll be talking about one.
The π½πΏπΌπ°π²ππ module provides you with the runtime version of your π‘πΌπ±π²π·π that is currently executing your script. With this piece of info, we could conditionally serve/run code based on the version we get.
A popular library called ππ²πΊππ²πΏ makes version number comparisons super simple, hence why it's used here.
If you pay close attention to my posts, you should notice that I didn't write π»πΌπ±π²:π½πΏπΌπ°π²ππ this time; since it's a new concept that wasn't available in versions below 8.
Did you learn something new today?
Like and share this post, and follow me for more!
Top comments (0)