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

Correctly support named exports of @value #399

Merged
merged 7 commits into from Feb 16, 2018
Merged

Correctly support named exports of @value #399

merged 7 commits into from Feb 16, 2018

Conversation

@tivac
Copy link
Owner

@tivac tivac commented Feb 16, 2018

Noticed this when upgrading, the change to export @values alongside classes in #398 caused a bug in my webpack/rollup code to become more obvious.

They were generating code like this:

export var a = ""b"";

since when you write @value a: "b" the literal value of a is "b", and I don't convert that to an unquoted string during the output process. Now it's using JSON.stringify(...) when exporting ALL values, which should be safer.

It may be worth adding support later for stripping the extraneous-seeming quotes off of @values that are solely "quoted strings" but I'm not touching that for now.

tivac added 3 commits Feb 16, 2018
Was quoting & not escaping values at all, which creates invalid JS in some cases. Now using `JSON.stringify()` for these values.

WARNING: code like `@value val: "value"` will be `"\"value\""` in JS, I don't want to introduce special handling for it.
@tivac tivac merged commit 166bfb2 into master Feb 16, 2018
1 of 2 checks passed
Loading
@tivac tivac deleted the named-export-values branch Feb 16, 2018
@tivac
Copy link
Owner Author

@tivac tivac commented Feb 16, 2018

Published in 8.0.2

Loading

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

Successfully merging this pull request may close these issues.

None yet

1 participant