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

Browser Compatibility #12

Open
bedeoverend opened this issue Apr 7, 2017 · 6 comments
Open

Browser Compatibility #12

bedeoverend opened this issue Apr 7, 2017 · 6 comments
Labels

Comments

@bedeoverend
Copy link
Collaborator

Currently custom-attributes doesn't specify what browsers it supports, so thought it might be worth discussing what to aim for.

I've been using it in https://github.com/simplaelements/simpla-paths and that's been running well in everything bar IE - IE11 is missing a few WeakMap / Map features e.g. map.keys(). I'm also transpiling it, so languages features are all fine.

@matthewp thoughts?

@matthewp
Copy link
Owner

matthewp commented Apr 7, 2017

I didn't design it with specific browser targets. MutationObserver is the one thing that we can't live without so I guess IE11 is the absolute minimum. If it's down to Map/WeakMap those can be polyfilled (kinda), so is it just a matter of documenting?

@matthewp
Copy link
Owner

matthewp commented Apr 7, 2017

By the way, I don't know how you feel but I'm against libraries shipping with polyfills. I think it adds unnecessary cost that not all usages need. I think it's better just to be upfront and say "will work in IE11 if you include a Map/WeakMap polyfill".

@bedeoverend
Copy link
Collaborator Author

Yeah I agree, generally don't think polyfills should get shipped with libraries. The only features that IE11 doesn't have that are currently needed are keys()and values(), which this uses just on Map. It would be nice to support IE11 out of the box, though I'm guessing using Array lookups would really hurt perf?

Other than that - what do you think about having a transpiled version? Or alternatively update it to use ES5 to support IE11.

@bedeoverend
Copy link
Collaborator Author

Or, obviously other option re: transpilation is just let people transpile themselves when they use it in their own projects.

@bedeoverend
Copy link
Collaborator Author

See #13 - that gives support for IE11. I realised that IE11 just has partial support for Map / WeakMap, so it meant tweaking usage slightly to get it to work.

@matthewp
Copy link
Owner

Sounds good. Would be nice to set up SauceLabs or something for browser testing.

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

No branches or pull requests

2 participants