I am working with various modern JavaScript frameworks like React, Vue, and Angular.
I have noticed that cross-browser compatibility issues remain a significant challenge. Despite advancements in frameworks and tools; certain features or functionalities can behave inconsistently across different browsers.
I have faced variations in CSS Grid implementations leading to layout inconsistencies; different browsers handling JavaScript events in subtly different ways; and significant performance variations in JavaScript-heavy applications across browsers. I have referred https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing_splunk documetation guide but still need help.
I want to know how others approach these challenges. Are there specific strategies; tools you use to ensure better cross-browser compatibility?
Uneven support for newer standards (and sometimes older like styling scrollbars in firefox) is our web-dev reality and price of openess of the web ecosystem.
My personal strategy is to be conservative with technologies I use (don’t jump on new stuff, use boring old stuff, don’t add dependencies mindlessly, etc). New stuff has tenendecy to change, not work, be less suported, not having known solutions to common problems and not having solutions to new problems. In practice this means that sometimes I use tables for layouts, sometimes I use framework for grid layouts (in angular), sometimes I go with the newest stuff and then just patch what does not work, or just go old-school stuff which just worked 10 years and will work another 10. Also being conversvative with choise of technology means that even if your choise is having issues people already figured out workaround.
My strategy was heavily influenced by concepts from “Antifragile” book by Nassim Taleb. These concepts are applicable beyond the examples from the book (like options traiding) Here is book’s summary from chatgpt
“Antifragile: Things That Gain from Disorder” is a book by Nassim Nicholas Taleb published in 2012. It presents a broad framework for understanding how different systems respond to stress, volatility, and disorder. Here are some of the main ideas from the book:
Antifragility Defined: Taleb introduces the concept of “antifragility” as something beyond resilience or robustness. While resilient or robust systems resist shocks and stay the same, antifragile systems benefit and grow from stressors and challenges.
Triad Concept: Taleb explains his ideas through a triad - fragile, robust, and antifragile. Fragile systems are harmed by volatility, robust systems resist it, and antifragile systems benefit from it.
Small is Beautiful: Smaller, decentralized systems are often more antifragile because they can adapt and react faster than large, centralized ones. This applies to businesses, governments, and other organizations.
Via Negativa: A significant portion of Taleb’s advice on becoming more antifragile involves removing things rather than adding them. This could mean reducing intervention in natural processes, simplifying technology, or removing unnecessary medication in healthcare.
Optionality: Having options is a core component of antifragility. Options allow for choices in response to changing circumstances, and having more choices generally increases the ability to benefit from disorder.
Skin in the Game: Taleb emphasizes the importance of having ‘skin in the game,’ meaning that decision-makers suffer consequences if things go wrong. This accountability leads to more robust and antifragile systems.
Non-Predictive Decision Making: Instead of trying to predict specific future events, which is often futile, Taleb suggests focusing on being prepared for a range of outcomes, especially unpredictable ones.
Barbell Strategy: This strategy involves having a combination of extremely safe and extremely risky investments, rather than settling for medium-risk. This can lead to high gains while minimizing exposure to catastrophic losses.
Disorder as Information: Volatility and stressors are not just challenges to endure but are also valuable sources of information and drivers of innovation. They help systems evolve and adapt.
Ethics of Fragility and Antifragility: Taleb discusses the ethical implications of fragility and antifragility, arguing that creating systems that transfer fragility to others (like certain financial strategies) is unethical.
“Antifragile” is a complex book that touches on economics, philosophy, finance, and risk management, arguing for a fundamental shift in how we perceive and handle the disorder in all aspects of our lives.