-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Design Meeting Notes, 5/14/2021 #44097
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
Comments
In regards to Also, for // Default type `Error`
try { } catch (error) {}
// Explicit `unknown`, requires type guards
try { } catch (error: unknown) {} |
@weswigham might have opinions here, but my understanding is that you would potentially want to have different behavior between import * as foo from "foo"; and import foo = require("foo"); Additionally, I think that we would disallow mixing these import forms outside of declaration files. |
Yes. An es6 like import or dynamic import sets the |
Do you plan to support conditional exports based on target env: browser/node and runtime development/production? |
In the examples, For example:
If not, I believe node will throw an |
Yes. |
I think it should work. We always get dependencies from the "true" package root (you can't declare dependencies from the package's subfolders), and only use nested |
ES Modules in Node
https://gist.github.com/weswigham/22a064ffa961d5921077132ae2f8da78
export
maps and.d.ts
filesThe same way we let you file a
types
field to reflect themain
, we should have a "types" condition in your export maps.Alternatively, "nested conditions" approach
typesVersions
?Version specifier in the
exports
map?Do we expect these
exports
to be written by hand?This is all quite a lot of complexity.
typesVersions
was explicit, this isn't.It's not necessarily just about ESM imports vs CJS require.
import+types>4.4
seems a little bit confusing, maybe "abusive" of the export map syntax..
is a path, anything not is "special"..d.ts
files like assets?)Seems like team slightly prefers nesting, not concatenating (e.g.
yadda+types
)typescript@>=4.4
types>=4.4
What about
typesVersion
.typesVersions
from the MVP, otherwise users have to specially support the MVP in a weird way."types<=4.5"
or"types@<=4.5"
?types@*
vstypes*
?types
.Breaking Changes
#44093
#44092
#44087
number
is assignable to, reduce everything.#43877
unknown
incatch
#41016
#41013
unknown
in a survey.any
understrict
.: any
incatch
clauses.--strict
.Error
".--strict
.The text was updated successfully, but these errors were encountered: