Skip to content

Allow any class names to be exported #9

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

Merged
merged 2 commits into from
Apr 9, 2019
Merged

Allow any class names to be exported #9

merged 2 commits into from
Apr 9, 2019

Conversation

bushee
Copy link
Contributor

@bushee bushee commented Apr 5, 2019

This change allows any possible class name to be exported - even those whose names don't comply with typescript variable name constraints.

Addresses problem from issue #6.

@silbinarywolf
Copy link

Maybe add a test that uses a hyphen for a class name? ie. 'Class--Name'
Just so it's less likely to be broken in the future / accidentally regressed :)

@bushee
Copy link
Contributor Author

bushee commented Apr 8, 2019

@silbinarywolf good point, idk why I haven't thought of it myself :(

@stephankaag
Copy link

stephankaag commented Apr 8, 2019

This stylesheet still gives problems:

:host {
background: 'blue';
}

->

// This file is automatically generated.
// Please do not change this file!
interface CssExports {
  ')(false);
// Module
exports.push([module.id, ': string;
}
declare var cssExports: CssExports;
export = cssExports;

@mattcompiles
Copy link
Collaborator

Hey Bud, This is a nice solution to the problem, thanks for working this out.

Can you just remove the "Doesn't silently ignore invalid TypeScript identifiers. If a class name is not valid TypeScript (e.g. .foo-bar, instead of .fooBar), tsc should report an error." line from the README as it's no longer valid.

@mattcompiles
Copy link
Collaborator

@stephankaag Your issue is unrelated to this one as it's broken with both approaches. Feel free to submit a separate PR to resolve it.

@bushee
Copy link
Contributor Author

bushee commented Apr 9, 2019

@MattsJones I'm on it :)

Copy link
Collaborator

@mattcompiles mattcompiles left a comment

Choose a reason for hiding this comment

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

Thanks for this.

Going to release as a new major to let users opt into the new declaration template. Versions are cheap 💸

@mattcompiles mattcompiles merged commit e7342df into seek-oss:master Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants