Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Gracefull degradation for old JS engines #10

Open
crazygolem opened this issue Aug 18, 2015 · 8 comments
Open

Gracefull degradation for old JS engines #10

crazygolem opened this issue Aug 18, 2015 · 8 comments

Comments

@crazygolem
Copy link

Unsupported browsers should display something along the line of "your browser is not supported because feature X is not available" when the UI cannot load correctly, instead of keeping the "Welcome! Please, take a seat..." message.

E.g. the interface won't work in Internet Explorer 11 on Windows 8.1, because it does not handle generator functions and the parser throws (SCRIPT1005: '(' attendu).

For some ES6 features, the code can be transpiled as a graceful degradation, even using an ad-hoc JS transpiler loaded by the webpage itself, but other features cannot be backported.

Generators can be rewritten to a certain extent to function with pre-ES6 engines (pun intended) (see https://github.com/lpaimen/YieldifyJS), but I am not sure that it can be generalized to all cases.

If we choose to only support the latest, cutting-edge browsers (IE11 is probably not in that category, even if it can still be considered recent), at least don't let the UI give up everything on unsupported browsers and let the user know that it won't work.

@crazygolem
Copy link
Author

Idea: use an error / onerror event handler for script tags that load external JS resources.
MDN resource

@gcmalloc
Copy link
Member

yeah, I would be in favor of testing for the list of feature we expect the browser to have. I don't really expect IE to work anyway.

@BinaryBrain
Copy link
Member

If you write some ES6, why don't you use something like Babylon.js?

@dgellow
Copy link
Contributor

dgellow commented Aug 19, 2015

@BinaryBrain I think you meant babel.js.
I'm already using it.

See the package.json: https://github.com/fixme-lausanne/mpdwsgi-web/blob/master/package.json#L53

@dgellow
Copy link
Contributor

dgellow commented Aug 19, 2015

@crazygolem I have no interest in supporting IE or safari (they don't support generators), if you want to work on it I think you could try with the Regenator runtime.

Like always, we accept Pull Request.

@crazygolem
Copy link
Author

Could you then provide a list of what you intend to support, e.g. in the readme?

Could you describe here briefly what you use babel.js for? (I'm new to this) Does it have something to do with your use of React?

For the record, I know that you accept pull requests. Opening bug reports does not mean that I request YOU to do something, merely that something can be done (possibly by me). Also it allows to discuss the bugs, and possibly give a no-go if something should not be put in there (support of IE6, rewrite in flash to support system clipboard, etc.)

@BinaryBrain
Copy link
Member

Oh! Yes of course, sorry.
Le 19 août 2015 14:50, "Samuel El-Borai" [email protected] a écrit
:

@BinaryBrain https://github.com/BinaryBrain I think you meant babel.js
http://babeljs.io/.
I'm already using it.

See the package.json:
https://github.com/fixme-lausanne/mpdwsgi-web/blob/master/package.json#L53


Reply to this email directly or view it on GitHub
#10 (comment)
.

@dgellow
Copy link
Contributor

dgellow commented Aug 19, 2015

Could you describe here briefly what you use babel.js for? (I'm new to this) Does it have something to do with your use of React?

@crazygolem babel.js is a compiler (also called transpiler by some people) from ES6/ES7 to ES5. It is used via babelify, a transformer plugin for browserify.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants