There is no magic.
1. Write your code using standard JavaScript, avoiding corner cases and features that aren't universally supported.
2. Use libraries (you decide the architecture and when to call them) instead of frameworks (they establish the architecture and your code has to fit within it).
Neither of these is a new argument, it's just the usual trade-off with using bleeding edge functionality or building around a framework, now applied to the world of front-end web development and JS: you can do more things quickly at first with these tools, but at the expense of introducing portability and maintenance overheads that might cost you further down the line. Whether the benefit outweighs the cost is something you have to consider on a case by case basis.