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

Apply flat polyfill globally #10222

Merged
merged 1 commit into from
Oct 10, 2021
Merged

Apply flat polyfill globally #10222

merged 1 commit into from
Oct 10, 2021

Conversation

jackwilsdon
Copy link
Contributor

Proposed change

Globally enable the Array.prototype.flat polyfill.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

On my older Android tablet (before I updated Chrome and Web View), I was seeing this error when trying to log in with the companion app:

"Uncaught (in promise) TypeError: e.flat is not a function", source: http://192.168.88.200/frontend_latest/authorize.328ad78a.js

This led me to #9404, where it appeared that the Array.prototype.flat polyfill had only been added to the core entrypoint. It looks like this polyfill might actually be needed globally (or at least also for the authorize entrypoint).

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

@bramkragten
Copy link
Member

You are actually doing the exact opposite to what you describe.

It was loaded globally, but you now moved it to compatibility, which is only loaded for ES5 builds.

You issue was solved already.

@jackwilsdon
Copy link
Contributor Author

Ah my apologies, I didn't realise that src/resources/compatibility.ts was only built into ES5 bundles. I'll just add the flat polyfill straight to src/entrypoints/authorize.ts then, as the core.ts entrypoint doesn't look to be used on that page.

Do you think we need it on any of the other entrypoints @bramkragten?

@bramkragten
Copy link
Member

authorize and onboarding then probably :-)

@bramkragten bramkragten merged commit 5bc0fea into home-assistant:dev Oct 10, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2021
@jackwilsdon jackwilsdon deleted the global-flat branch September 11, 2022 12:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants