-
Notifications
You must be signed in to change notification settings - Fork 17
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
doc: add strip-types proposal #210
doc: add strip-types proposal #210
Conversation
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.
Thanks! Dropped some nit picking comments. Going to take another look soon.
f0412be
to
73bc680
Compare
doc/design/proposal-strip-types.md
Outdated
* `module` declaration | ||
|
||
With types stripped, unless transformation is performed, these features will error. | ||
This is probably the biggest limitation of this proposal, since we are not implementing these features. |
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.
Cross-posting from the slack channel, since folks seem to think this is an interesting idea..
Speaking on detection, can we do detection on TypeScript transform too? i.e. strip types and try to run it first. If there are syntaxes requiring transform, do the transform - but the transform is not part of LTS?
So instead of only having a stable subset, we include a stable subset + a never stable subset (which the TypeScript team wants, AFAICT)
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.
I guess the question is what’s the future of these transforms. TypeScript hasn’t added new transforms in quite a while, and they seem to be phasing them out; they discourage enums nowadays per what @JakobJingleheimer found, and other transforms like private
class fields and legacy decorators have been superseded by standardized syntax.
In other words, the only people needing transforms are users who’ve written older TypeScript; it seems like the transform-requiring syntax is discouraged nowadays. I’d like to hear something about this from the TypeScript team themselves, though; if they can attest that a) current transforms won’t change, and b) they aren’t adding new transforms, then sure, we might as well support transforms as there isn’t potential for breaking changes.
On the other hand, if transforms are a legacy thing, we could be more forward-looking and just never support them from the start and hasten their demise. Users who want transforms can keep running TypeScript however they are now, and we focus on the future users who will be writing a TypeScript that aligns with type stripping and the Type Annotations proposal.
doc/design/proposal-strip-types.md
Outdated
|
||
### Goals | ||
|
||
#### Determining module system |
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.
The latter half of this document is just a copy of the docs from the PR, but those docs are likely to continue to change. Rather than having two documents to keep in sync, can we focus this one on the high level and just link to the PR for implementation details?
I think a good thing for this document to cover would be the pros and cons of this approach as compared with others, as that’s something that we wouldn’t discuss in the API docs.
Based on yesterday's call, I think you need to add a few sections:
I think clarity around these points should meet @DanielRosenwasser's concerns. My take is that stripping types is for end-user apps and small scripts. We should not be running |
1d34bfd
to
45dc54a
Compare
45dc54a
to
b8db8d6
Compare
updated |
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.
lgtm
Follow-up proposal for #208
Wording and bikeshedding welcome 😸