Every time the code reaches a piece where the code soloution needs to execute different parts depending on the setup, there need to be used execution time on tests to go the right path. That takes up time and affects performance.
I guess that it is common practice and have been so since the beginning of the coding history. Guess that it is a pattern which have become the default way of doing it. I guess that there exists many good reasons for coding like that.
I would suggest that tests should be made to split big APIs like jQuery or MDAngularJS and Polymer into smaller platform specific files. I am not a software arcitect but I thing that it would be doable.
The code could be fetched using a parameter:
It could be served with a parameter in the name:
It could be served based on Request parameter, so some logic on the webserver served the correct version.
Ofcause there are arguments against such patterns. Like back in old days on Microsoft IIS webserver a file was used to detect which browser was visiting the site. It was hell to maintain that soloution.
Please share your thoughts on this subject below in the comments area.