Closed
Description
--isolatedDeclarations
- It is preferable to check against declaration files (
.d.ts
files) because there is no need to check against the implementation. - Wouldn't it be nice if you could emit those files without checking and just check against those?
--isolatedDeclarations
ensures that your files could be emitted that way.- Most of our stuff is annotated, right?
- For the majorish stuff?
- Have to think about
/** @internal */
- Does this mode expect everything to be modules?
- We don't think so.
- Authors of esbuild and swc have both said they're interested in operating over this mode.
- Are they interested in just declaration emit, or declaration bundling?
- Need to clarify with others, but feels like both?
- There are tools like tsup that just uses Rollup to do the same bundling logic over declaration files.
- Are they interested in just declaration emit, or declaration bundling?
- Would we use this on TypeScript itself?
- Blocker is what our API is.
- 2 stages:
emitDeclarationOnly
to produce.d.ts
files- Our bespoke bundler that merges it all.
- How does this work for
--build
mode?- Currently we depend on if the
.d.ts
is older than the input files.- So check the JS files.
- What if you're using
noEmit
? You need build-mode checking, but not emit. .tsbuildinfo
?
- Can't meaningfully leverage this without parallelism
- Currently we depend on if the
- Is it expected that other tools would just do the transform, or would we?
- Both, similar to
transpileModule
. - Big win for the community would be that others would understand this mode.
- Both, similar to
- What about the DX around
export const x = 10
- that's an error without a type.- Could be more lenient over time.
- Unclear if people know what they're signing up for
- What is the correct return type of every React component?
JSX.Element
?
- What is the correct return type of every React component?
- Declaration Maps?
- Source-to-source translation, so it should be "free".
- Yes, for us - what about everyone else?
- Should really encourage implementers to support declaration maps in some way.
- Really want go-to-definition to work well.
- We're not sure if we want a separate walker - would rather use the existing declaration emitter.
- Do we even need to support a mode here? Couldn't external tools do this?
- Arguable that we have no work to support this mode - tools can already do declaration emit.
- We're setting the base minimum, and giving you a heads up in the editor of what will and won't work.
- Becomes weird if we make things more lax down the line.