-
Notifications
You must be signed in to change notification settings - Fork 509
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
Generics: Use %-encoded escaped names to prevent clashes #475
Conversation
A note on contextualized names The node name TS returns is not always unique and can't be used on itself to determine equality: interface Generic<T> {
t: MyInterface<T>
}
let a: Generic<string>
let b: Generic<number> Will both return the name |
@dgreene1 would you be comfortable reviewing this? |
@WoH if I recall, this is the PR that will need to be a 3.0 release right? If so, I’m hoping to close some of the minor features first so they can get out to the majority user. Maybe that’s unnecessary though? |
I'd personally prefer to merge this in a 3.x release alongside type aliases and some other things concerning type resolution. |
@dgreene1 I'd like to build on top of this, should I just keep pushing on top so you can filter commits and review or is should I open more PRs? Does it make sense to target a new branch for the whole thing? |
For now it probably makes sense to keep adding to this PR. Unless the new code is for a completely different feature, then it’s okay to make a new PR that depends on this one. But I have a note in my ToDo app to get back to this so it doesn’t have to languish out here. Meanwhile I’m investigating how branches and tags work when you publish to NPM. It seems to be a bit of a headache. So my current plan is to just close and publish all of the small items that are in review and then head to v3 as latest. |
@WoH did you mean to close this? If so, why? (Is it because the other PR includes all of the other changes as it’s base?) Btw, I emailed Luke to make you a contributor (which is the only level available for non organizations). |
Yes, I closed both PRs and opened the typealias PR based on version 2.5.5. |
Okay cool. I just wanted to make sure I didn’t mess you up with that big change. |
All Submissions:
Closing issues
Closes #470
If this is a new feature submission:
Potential Problems With The Approach
This changes the names of the generated schemas and therefore may be a breaking change if you rely on the names of the schemas (if you do, please tell me why)
Test plan
I updated existing names. By additionally encoding potentially unescaped by illegal characters, it should be impossible to generate illegal names (although they will be harder to decipher)
I believe we could hold off on this for 3.0 and merge it together with type alias changes I'm currently working on.