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

volar code action on save is slow #3326

Closed
tjx666 opened this issue Jun 26, 2023 · 6 comments
Closed

volar code action on save is slow #3326

tjx666 opened this issue Jun 26, 2023 · 6 comments

Comments

@tjx666
Copy link
Contributor

tjx666 commented Jun 26, 2023

image

image

After set "vue.codeActions.enabled": false, the save operation became very fast.
Seems there is no way to check the vue code action costs now.

After I test, I found if the ts types is resolved completed, the volar code actions would be fast.
Seems the volar code action rely on ts type info...

Volar version: v1.8.1
Take Over Mode: yes
Version: 1.79.2
Commit: 695af097c7bd098fbf017ce3ac85e09bbc5dda06
Date: 2023-06-14T08:58:33.551Z
Electron: 22.5.7
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.5.0
@johnsoncodehk
Copy link
Member

johnsoncodehk commented Jun 26, 2023

After remote investigation to the project, the project is loading 7xx vue files outside the current directory (And total ~1000 vue files), resulting in TS high overhead. External vue files are no longer automatically parsed after 1.8.2.

@rchl
Copy link
Collaborator

rchl commented Jun 26, 2023

Would you mind clarifying how did those external files ended up being referenced and parsed? Specific project configuration or plain bug in directory traversal?

@eugene-makarov
Copy link

@johnsoncodehk What is the recommended way to "parse external files"? This change broke our monorepo config and we are getting these errors

// packages/webapp/tsconfig.app.json
{
  "extends": "@vue/tsconfig/tsconfig.web.json",
  "include": ["*.vue", "env.d.ts", "src/**/*", "src/**/*.vue", "src/**/*.json", "src/**/*.ts"],
  "exclude": ["src/**/__tests__/*", "node_modules"],
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@common/*": ["../common/src/*"],
      "@webapp/*": ["../webapp/src/*"]
    }
  }
}

After 1.8.2
image

@jmroon
Copy link

jmroon commented Jul 25, 2023

@johnsoncodehk bumping the above question, as this is an issue for a monorepo setup.

Currently, manually specifying includes seems like the only way out in a typical monorepo setup that doesn't only have a base tsconfig. Ideally, this behavior should be at the very least opt-out to bring it in line with with how other frameworks behave in ts monorepos.

I understand that your own personal recommendation is to just keep one root tsconfig, or minimize the amount of tsconfigs. While this is appropriate for an open source package based monorepo where the goal is to distribute many packages from a shared code base, the typical enterprise monorepo is counter to that. There, you might have packages of varying configs (e.g. node backend, vue frontend, internal libs, compiled libs, etc...) and so a single ts config is typically not appropriate.

Ideally, Volar would parse files that are either in tsconfig paths (for integrated monorepos) or workspace linked dependencies (for package based monorepos).

@tjx666
Copy link
Contributor Author

tjx666 commented Jul 26, 2023

I had been staying at 1.8.1 for long time..., and just disable the code action

@MatthewAry
Copy link

Just a suggestion, could an option be added to prevent volar from engaging on a save action? I can't find a setting for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants