Skip to content

feat: discard queued tasks if running them as microtasks isn't supported #77

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

Merged
merged 3 commits into from
Sep 15, 2019

Conversation

nilskuhn
Copy link
Contributor

I want to use perfume but have to support IE < 11 :(

I would prefer to discard measurements from that small user group (in the case measurement tasks got delayed until unloading of page) instead of integrating mutation-observer polyfill for all our users to support measurement for IE < 11.

I'm not the greatest event loop / microtask expert, so if there is a possibility to get measurement tasks handled on unloading of a page without promises and MutationObserver in place please give me a hint or feel free to supplement.

@nilskuhn
Copy link
Contributor Author

The only effect of this would be that browsers that do not support Promises or MutationObserver (currently mainly IE < 11 and Opera mini) would not cause a JS error. Values are not provided by these browsers with or without this fix.

Could anybody please review this?

@Zizzamia Zizzamia self-requested a review September 1, 2019 06:25
@Zizzamia Zizzamia self-assigned this Sep 1, 2019
@Zizzamia Zizzamia removed their request for review September 1, 2019 06:25
@Zizzamia Zizzamia added the feat label Sep 1, 2019
@Zizzamia Zizzamia added this to the v2.1.0 milestone Sep 1, 2019
Max Berndt added 2 commits September 4, 2019 12:09
Since we use basic Map features (get, set, has, delete) only, we can
as well just replace our maps by objects to support IE < 11 and other
browser that do not recognize ES6 specifications.
This keeps the bundle small and avoids the need of costy polyfills.
@Zizzamia Zizzamia self-requested a review September 8, 2019 23:39
@Zizzamia Zizzamia modified the milestones: v2.1.0, v3.0.0 Sep 9, 2019
Copy link
Owner

@Zizzamia Zizzamia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
In Perfume.js v3 we will start not to supporting some of the emulated functionality we have in v2.
I'm going to merge this PR and move on to publish it on the new v3-beta.1
Thank you for supporting Perfume.js
🌕🌲🦕

@Zizzamia Zizzamia merged commit bc7d927 into Zizzamia:master Sep 15, 2019
@Zizzamia
Copy link
Owner

The code has been published under v3.0.0-beta.0

Please let me know if works all good!

Also, v3 is going to have some nice extra feature, but before the full roll-out, I'm going to have a couple of extra betas.

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

Successfully merging this pull request may close these issues.

2 participants