-
Notifications
You must be signed in to change notification settings - Fork 394
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
Declare a minimum supported version of TypeScript (v2) #447
Labels
Milestone
Comments
Useful for reference:
|
This looks great to me 👍 |
Sweet! Let's do it! Figure we want to update the dep in |
This was referenced Mar 30, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Bolt for JS is great to use in a TypeScript project because it gives you lots of useful information about the Slack platform while you're writing your code (as opposed to when you're running your code).
TypeScript doesn't use SemVer version numbers the way most dependencies do. A developer using TypeScript depends on the declaration files emitted from this project. TypeScript introduces features in minor versions which can change in a backwards incompatible manner. So a version specifier like
^3.4.3
(the specifier used onmaster
right now) doesn't adequately communicate compatibility. Therefore in order to communicate compatibility, we need to pick a minimum minor version that we intend this package to be used with. We can use integration tests to verify compatibility of the declaration files against that minor version.In the Node Slack SDK, the minimum TS version changes once per major version of the package(s). We can use the same policy in Bolt for JS.
Since v2 is almost ready to release, we can pick that version now. We want to find a version that balances new features with value to this project (at this major version) and old enough that most users won't have a difficult time to upgrade to using it.
I propose for
v2.0
, we set the minimum TypeScript version to 3.7. This version was released in Oct 2019. The current version is 3.8, which leaves the following declaration-impacting features as ones we cannot use for v2.x of Bolt for JS:Type-only imports and exports
WebClient
orLogger
). A side-effect is that the emitted code still produces arequire()
that isn't technically needed. This feature would help eliminate those unnecessaryrequire()
s.ECMAScript private fields
private
properties to store data which users should not access. However, if they wanted to access them, they still could. This feature would allow us to enforce the privacy of that data which can eliminate whole classes of errors. It also limits the freedom of how our classes can be used (especially subclassing). It's not clear there is a need for enforcing privacy of data at this time.There will be more features in future versions of TypeScript that we cannot use, that is inevitable in declaring a minimum supported version. However, these are the significant features we gain (over TypeScript 3.4 which can loosely be interpreted as our current supported minimum):
?.
,?()
) Nullish Coalescing (??
)body
,state
, and other places where we currently useStringIndexed
to roughly mean "a bag of data".useDefineForClassFields
get
andset
accessors in ambient contextsimport
/export
) syntax.Omit
helper typeRequirements (place an
x
in each of the[ ]
)The text was updated successfully, but these errors were encountered: