Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document and address browser / ES version considerations #222

Open
3 tasks
fedarko opened this issue Jun 29, 2020 · 1 comment
Open
3 tasks

Document and address browser / ES version considerations #222

fedarko opened this issue Jun 29, 2020 · 1 comment
Labels
documentation refactoring Use best practices or improve the usage of public APIs

Comments

@fedarko
Copy link
Collaborator

fedarko commented Jun 29, 2020

From code review:

  • Possible to use Map instead of Object. Pretty much all non-IE major browsers support this, and there seem to be some performance benefits besides the obvious extra clarity of seeing that something is explicitly a mapping

  • Be consistent with var, let, and const. I just did some quick estimates by running grep -ri "let " empress/support_files/js/* | wc -l, etc. and found that there are 412 vars, 9 lets, and 4 consts in the Empress JS codebase. We should prooobably just make everything var.

  • Use foreach instead of for loops? Where possible, and where it wouldn't be an efficiency decrease. (Maps can apparently be directly iterated over, so maybe those would pair well with this.)

We may want to go about this by figuring out what browser / JS version we want to target, and then... adjusting our build setup accordingly? Maybe by adjusting jshint, or adding Babel somewhere to verify that we can use these things and still target all the environments we want to support. I'm not really sure what the best practice would be (I suspect it'd involve a lot of messing around with adding webpack or rollup to the project).

Thanks @dhakim87, @wasade, and @qiyunzhu for bringing up these points respectively during code review today!

Edit: we should also update the documentation to mention things like browser requirements, etc.

@fedarko fedarko added the refactoring Use best practices or improve the usage of public APIs label Jun 29, 2020
@fedarko
Copy link
Collaborator Author

fedarko commented Jul 23, 2020

From discussion with @ElDeveloper and @kwcantrell, it sounds like we're mostly moving towards just supporting Firefox / Chrome for now. So using JS features that e.g. break IE is ok.

@fedarko fedarko changed the title Browser / ES version considerations Document and address browser / ES version considerations Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation refactoring Use best practices or improve the usage of public APIs
Projects
None yet
Development

No branches or pull requests

1 participant