I tried a lot in the past few weeks to find a documentation on TS Compiler, I couldn't find any. I opened an issue asking for the documentation: https://github.com/microsoft/TypeScript-Website/issues/2428 and then I got to know the TypeScript-Compiler-Notes repository. I believe it could help a lot if it was in CONTRIBUTING.md file.
* Add test when declaration emit has errors and d.ts emit doesnt change which results in incorrect incremental behaviour
* Refactor
* Use declaration diagnostics in the d.ts signature for the file so it can be more accurate for detecting changes to file that could affect other files
Fixes#49527
* Renames and clarifications
* Simplify serialize declaration diagnostics for signature purpose
Do not serialize file name if error is in same file we are emitting. this should avoid having to do file path computation in most cases.
Locations are start and length instead of line and character.
Do not use any indents
* Fix baselines
* Add a simple queue implementation with better performance than `Array.shift`
This lets us clean up the hack introduced in #49581
* Correct typo
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
* Add fractionalSecond part type to DateTimeFormat().formatToParts
This change adds the `fractionalSecond` part type as a valid part
to be returned from Intl.DateTimeFormat().formatToParts().
Fixes microsoft#48882
* fixup
* add bug repro test
* add test and start fix implementation
* adjust for useAlias preference
* fix existing renaming test
* refactor to get rid of options
* fix named bindings & other imports cases
* fix eslint error
* address cr comments
* hopefully actually fix eslint
* clean up stale baseline
* make API change non-breaking
* add/fix comments
* Tune FAR aggregation
In making the work queue management more intelligible, we centralized the redundancy check at dequeue time. As a result, the queue tends to get very large (~1.6M items for `SyntaxKind` in this repo) and dequeuing via `shift` is too slow to do that many times. This change makes a few tweaks:
1. Use `Project` identity for de-duping and only maintain a set of keys for `loadAncestorProjectTree`
2. Attempt to filter prior to insertion
3. Use `splice` if many consecutive work queue items will be discarded.
On my box, this cuts FAR for `SyntaxKind` in parser.ts from 38 minutes to 20 seconds (we could do better, but effectively decided not to optimize this worst case scenario).
* Prototype TS plugins on web
This prototype allows service plugins to be loaded on web TSServer
Main changes:
- Adds a new host entryPoint called `importServicePlugin` for overriding how plugins can be loaded. This may be async
- Implement `importServicePlugin` for webServer
- The web server plugin implementation looks for a `browser` field in the plugin's `package.json`
- It then uses `import(...)` to load the plugin (the plugin source must be compiled to support being loaded as a module)
* use default export from plugins
This more or less matches how node plugins expect the plugin module to be an init function
* Allow configure plugin requests against any web servers in partial semantic mode
* Addressing some comments
- Use result value instead of try/catch (`ImportPluginResult`)
- Add awaits
- Add logging
* add tsserverWeb to patch in dynamic import
* Remove eval
We should throw instead when dynamic import is not implemented
* Ensure dynamically imported plugins are loaded in the correct order
* Add tests for async service plugin timing
* Update src/server/editorServices.ts
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Partial PR feedback
* Rename tsserverWeb to dynamicImportCompat
* Additional PR feedback
Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>