emscripten-core / emscripten-core/emscripten

Browser support policy

Aperta
#20,601 7 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
C++
Stelle
27.6k
Fork
3.6k
Merge medio
1g 14h
PR unite (30g)
125

Descrizione

We don't have a formal policy, so I thought to open this issue for discussion.

Currently we support recent browsers - a few years old - by default, specifically Chrome 85, Firefox 79, Safari 14.01, all from 2020. That is what `MIN_X_VERSION` sets by default, and we make sure that building with that is efficient, that is, it does not require transpiling the JS to an earlier version (which means we don't use more recent features in `src/library*.js` etc.).

We also support older browsers if users adjust `MIN_CHROME_VERSION` etc. to lower values, which can cause us to transpile the code to an older JS version. There is also `LEGACY_VM_SUPPORT` which sets all `MIN_X_VERSION` to 0 and tries to support as much as possible at all costs.

I think the first part, of supporting recent browsers in the 2-3 year span by default, makes sense, and we've done it for a while without issue. We don't have a clear policy on how far back older versions should be supported, so that's worth discussing. The tradeoff would be removing support for ancient browser limitations to clean up the code, at the cost of some people potentially needing to use older `emcc` versions that still had that support.

The general form of our policy might look like this:

* X year old browsers are supported by default, and without transpiling.
* Y year old browsers are supported by flipping flags and will require transpoling and polyfills.

If that form makes sense that it leaves the question of what values to use for X and Y. (Atm we use 2-3 for X, and haven't really decided about Y.)

My general feeling is that if a few percent of our users still support some platform, then we should as well, as part of our legacy support. For comparison, MediaWiki/Wikipedia seems to have the [highest level of support](https://www.mediawiki.org/wiki/Compatibility#Browser_support_matrix) for 3 year old Chrome and Firefox, 5 year old Safari, and 9 (!) year old Android. They also have lower levels of support for 10 year old Chrome and Firefox. I am mainly just mentioning this as context for how a major and important website thinks about compatibility, but I'd also be curious about Wikipedia's current usage of Emscripten and browser features - iirc it was for codecs, but maybe those are now widespread enough anyhow? cc @brion

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Iniziare esaminando le impostazioni MIN_X_VERSION, MIN_CHROME_VERSION e LEGACY_VM_SUPPORT e il codice dipendente dal browser in src/library*.js. Il lavoro sarà completato quando il progetto avrà concordato le soglie X e Y di anzianità dei browser e avrà documentato una policy formale di supporto, comprese le aspettative per il supporto predefinito, legacy, la transpilation e i polyfill.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, wasm
Ambito
compilers, web-dev
Tipo di issue
Documentazione
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.