-
Notifications
You must be signed in to change notification settings - Fork 511
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
"for of" loop is not supported by legacy browsers. #248
Conversation
I don't think we need to whole polyfill package for just startsWIth. I've substituted it with substring in this patch. |
@kaushlakers This isn't just for We have many tests that are failing when upgrading to the newer version of twitter-text due to lack of support. One of your dependencies bundled in the library has the same issue: This error exists in the travis builds as well: https://travis-ci.org/twitter/twitter-text/jobs/333552627 |
See this for an explanation: babel/babel-loader#84 |
@rcastera good point. I don't think it's twitter-text's responsibility as a text parsing library to polyfill browser features for legacy browsers. We use this polyfill internally. As a follow up, I can try to raise a PR to the punycode.js lib to replace the "for of" loops. From what I can see, we can safely change it to use a for loop since it is always an array. |
@hansott are you planning to raise a PR to punycode or shall I go ahead? :) |
@kaushlakers Feel free to do so 😉 |
Thanks @kaushlakers @hansott @kaushlakers will you create a PR to apply this patch as well? |
@kaushlakers I'll update this PR with the patch. Thanks! |
@kaushlakers updated the PR. I also removed this unused variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the rake package command was slightly wrong as it missed a build step. I've updated the README with the correct command. Can you rerun and generate the standalone pkg files again (with the rc tag i.e. 2.0.4-rc1)? Looks like this is missing punycode bundled in.
https://github.com/twitter/twitter-text/blob/master/js/README.md#packaging
Added an rc tag to the version. I'd prefer to release a full version after we resolve the issue in punycode as well.
-Adding babel-polyfill for supporting older browsers
-Resolves #247
-Resolves error
ReferenceError: Can't find variable: Symbol in bower_components/twitter-text/js/pkg/twitter-text-2.0.2.js (line 854)