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

UI: Bugfix. Move to a different TextEncoder/Decoder #4613

Merged
merged 2 commits into from
Sep 12, 2018

Conversation

johncowen
Copy link
Contributor

  1. The previously used TextEncoder/Decoder (used as a polyfill for
    browsers that don't have a native version) didn't expose an encoder via
    CommonJS. Use a different polyfill that exposes both a decoder and an
    encoder.
  2. The feature detection itself was flawed. This does a less error prone
    detection that ensures native encoding/decoding where available and polyfilled
    encoding/decoding where not available.

Fixes #4570

1. The previously used TextEncoder/Decoder (used as a polyfill for
browsers that don't have a native version) didn't expose an encoder via
CommonJS. Use a different polyfill that exposes both a decoder and an
encoder.
2. The feature detection itself was flawed. This does a less error prone
detection that ensures native encoding/decoding where available and polyfilled
encoding/decoding where not available.
@johncowen johncowen requested a review from a team August 29, 2018 15:13
@johncowen johncowen added the theme/ui Anything related to the UI label Aug 29, 2018
@johncowen johncowen requested a review from pearkes September 11, 2018 18:08
@johncowen johncowen added this to the 1.2.3 milestone Sep 12, 2018
@@ -1,8 +1,8 @@
import TextEncoderLite from 'npm:text-encoder-lite';
import TextEncoding from 'npm:text-encoding';
import base64js from 'npm:base64-js';
export default function(str, encoding = 'utf-8') {
// str = String(str).trim();
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be cleaned up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doh! Yup, done, cheers!

@johncowen johncowen merged commit e5f300d into master Sep 12, 2018
@johncowen johncowen deleted the bugfix/gh-4570-edge-text-encoder branch September 12, 2018 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/ui Anything related to the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants