-
Is the documentation on this page outdated? I'm looking at the lit-element-starter-ts repo and it's using slightly different settings Questions For "module" should we use "es2015" or "es2020" or does it not really matter. For "lib" should I use "DOM.Iterable"? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Apart from what we are recommending strongly in https://lit.dev/docs/tools/publishing/#compiling-with-typescript the other tsconfig concerns are mostly left up to the developer to address the specifics of their audience, pipeline, and deployment scenario etc. AFAICT the primary reason for using newer targets is to reduce the runtime cost and bloat of inlined compilation of newer features to older analogs. Advancing the module support to es2020 from es2015 shouldn't pose an issue as far as I'm aware and I believe the recommendations on our page are meant to define a comfortable lower-bound where there is little to no syntactical "downsampling" in target compilation. |
Beta Was this translation helpful? Give feedback.
To add to this:
We are making a small update to the doc site for v3 as we do plan on bumping our target to
es2021
. https://lit.dev/docs/v3/tools/publishing/#compiling-with-typescript"module"
doesn't matter much beyondes2015
unless you're doing dynamic imports, useimport.meta
or do top level awaits. https://www.typescriptlang.org/tsconfig#es2015es6es2020es2022"DOM.Iterable"
is needed if you need DOM lists likeNodeList
to be iterable, like tofor...of
or spread, etc. We do need it in our library code as we do take advantage of that, but I want to say if you don't need it yourself, it might be okay to drop it.