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

Fix standalone tag when data-type is not set. #11624

Merged
merged 1 commit into from May 27, 2020

Conversation

dfabulich
Copy link
Contributor

@dfabulich dfabulich commented May 27, 2020

Fixes #11621.

Q                       A
Fixed Issues? Fixes #11621, fixes #11628
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? No
Documentation PR Link
Any Dependency Changes?
License MIT

I thought getAttribute returned undefined when the attribute was unset, but it actually returns null. 🤦‍♂️

I manually tested this patch with and without a data-type attribute. (It appears that the babel-standalone script tag has no tests?? I might add some later, but for now, I want to fix this bug right away.)

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 27, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4adbbfb:

Sandbox Source
determined-dream-hx66g Configuration
nifty-burnell-nuh4x Configuration

@babel-bot
Copy link
Collaborator

babel-bot commented May 27, 2020

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/22977/

@nicolo-ribaudo
Copy link
Member

Thanks!
Yeah, we should figure out how to test this.

nicolo-ribaudo
nicolo-ribaudo previously approved these changes May 27, 2020
@nicolo-ribaudo nicolo-ribaudo added pkg: standalone PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels May 27, 2020
@nicolo-ribaudo nicolo-ribaudo dismissed their stale review May 27, 2020 07:56

I see an empty string i my browser 🙃 Maybe it's better to just do if (!script.type)?

@existentialism
Copy link
Member

existentialism commented May 27, 2020

Yeah let's go with a falsytruthy check

@dfabulich
Copy link
Contributor Author

Switched to a truthy check. if (script.type)

I'm a bit surprised to see that y'all had an empty string; I tested the previous version on Chrome 83, Safari 13.1, and Firefox 76, both with and without a data-type attribute.

@existentialism existentialism merged commit 05804b1 into babel:master May 27, 2020
@existentialism
Copy link
Member

@dfabulich thanks for the quick fix!

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Aug 27, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: standalone PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

babel stand alone version 7.10.0 doesnt work In-browser JSX translation broken with 7.9 -> 7.10 upgrade.
4 participants