Skip to content
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

WIP: Efficient external file watching #19

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mizdra
Copy link
Owner

@mizdra mizdra commented Oct 14, 2023

ref: vuejs/language-tools#3649, microsoft/TypeScript#56047

Until now, it was not possible to watch asset file additions with tsserver alone. Therefore, typescript-plugin-asset used ts.sys.watchDirectory to watch asset file additions on its own.

Normally, watching the file system is expensive. Therefore, it is not a good idea for both tsserver and plugin to watch the file system. Only one of them should do the watching.

In this PR, watching the asset files is also left to the tsserver side and the watching in the plugin is removed.

- Remove the feature for typescript-plugin-asset to watch files using its own glob.
- Use the include/exclude option in tsconfig.json instead.
- Only tsserver can watch files.
@mizdra mizdra added the Type: Other Cannot be classified into any other type. label Oct 14, 2023
"react-dom": "18.2.0"
},
"devDependencies": {
"typescript": "^5.3.0-dev.20231014"
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to wait for the merge until the vscode release bundled with typescript 5.3.

@mizdra mizdra added Type: Change Change existing functionality. and removed Type: Other Cannot be classified into any other type. labels Oct 14, 2023
### `exclude`

Glob pattern of assets to exclude. `@mizdra/typescript-plugin-asset` does not complete import statements for assets matching this pattern.

Copy link
Owner Author

@mizdra mizdra Oct 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include/exclude options are obsoluted. The users should use https://www.typescriptlang.org/tsconfig#include or https://www.typescriptlang.org/tsconfig#exclude instead.

This is breaking changes.

@mizdra mizdra added the Status: Blocked Progress on the issue is Blocked label Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Blocked Progress on the issue is Blocked Type: Change Change existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant