blitz-js / blitz-js/legacy-framework

Slow typescript definition with vscode

Open
#28 33 comments 7 reactions 0 assignees View on GitHub
kind/bug legacy-framework status/ready-to-work-on
Dominant language
JavaScript
Stars
3
Forks
2
PR merge metrics
No merged PRs in 30d

Description

### What is the problem?

Ever since I updated blitz from v0.33.0 to v0.37.0 I've noticed a huge delay in retrieving type definitions and autocomplete when using vscode.

### Paste all your error logs here:

```
N/A
```

### Paste all relevant code snippets here:

## V0.37.0 Dependencies
```
"dependencies": {
"@hookform/resolvers": "2.5.2",
"@prisma/client": "2.24.1",
"blitz": "0.37.0",
"prisma": "2.24.1",
"react": "0.0.0-experimental-6a589ad71",
"react-dom": "0.0.0-experimental-6a589ad71",
"react-error-boundary": "3.1.3",
"react-hook-form": "7.7.1",
"react-hot-toast": "2.0.0",
"slugify": "1.5.3",
"superjson": "1.7.4",
"zod": "3.1.0"
},
"devDependencies": {
"babel-plugin-superjson-next": "0.3.0",
"@next/bundle-analyzer": "^10.0.6",
"@testing-library/react": "11.2.5",
"@testing-library/react-hooks": "^4.0.1",
"@types/preview-email": "2.0.0",
"@types/react": "17.0.2",
"eslint": "7.21.0",
"husky": "6.0.0",
"lint-staged": "10.5.4",
"prettier": "2.2.1",
"pretty-quick": "3.1.0",
"preview-email": "3.0.3",
"typescript": "4.1.5"
}
```

## V0.37.0 .eslintrc.js
```
module.exports = {
extends: ["blitz"],
}
```

## Version v0.33.0 Dependencies
```
"dependencies": {
"@hookform/resolvers": "1.3.5",
"@prisma/cli": "~2.12",
"@prisma/client": "2.19.0",
"blitz": "0.33.0",
"handlebars": "4.7.6",
"nodemailer": "6.4.17",
"preview-email": "3.0.3",
"prisma": "2.19.0",
"react": "0.0.0-experimental-4ead6b530",
"react-datepicker": "3.7.0",
"react-dom": "0.0.0-experimental-4ead6b530",
"react-error-boundary": "2.3.2",
"react-hook-form": "6.13.1",
"react-hot-toast": "1.0.0",
"secure-password": "4.0.0",
"slugify": "1.4.6",
"superjson": "1.4.1",
"typescript": "4.1.3",
"zod": "1.11.11"
},
"devDependencies": {
"@testing-library/jest-dom": "5.11.6",
"@testing-library/react": "11.2.2",
"@testing-library/react-hooks": "3.7.0",
"@types/googlemaps": "3.43.1",
"@types/jest": "26.0.19",
"@types/react": "16.14.2",
"@types/secure-password": "3.1.0",
"@typescript-eslint/eslint-plugin": "4.10.0",
"@typescript-eslint/parser": "4.10.0",
"babel-eslint": "10.1.0",
"babel-plugin-styled-components": "1.12.0",
"babel-plugin-superjson-next": "0.1.8",
"concurrently": "5.3.0",
"eslint": "7.16.0",
"eslint-config-react-app": "5.2.1",
"eslint-plugin-flowtype": "5.2.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-react": "7.21.5",
"eslint-plugin-react-hooks": "4.2.0",
"husky": "4.3.6",
"jest": "26.6.3",
"jest-environment-jsdom-fourteen": "1.0.1",
"jest-watch-typeahead": "0.6.1",
"lint-staged": "10.5.3",
"prettier": "2.2.1",
"pretty-quick": "3.1.0",
"react-test-renderer": "16.14.0",
"ts-jest": "26.4.4"
}
```
## V0.33.0 .eslintrc.js
```
module.exports = {
env: {
es2020: true,
},
extends: ['react-app', 'plugin:jsx-a11y/recommended'],
plugins: ['jsx-a11y'],
rules: {
"import/no-anonymous-default-export": "error",
'import/no-webpack-loader-syntax': 'off',
'react/react-in-jsx-scope': 'off', // React is always in scope with Blitz
'jsx-a11y/anchor-is-valid': 'off', //Doesn't play well with Blitz/Next usage
},
}

```

### What are detailed steps to reproduce this?

1. Use any latest example or generate a new project with blitz cli
2. Make any change that should cause a typescript warning, or highlight any variable and get stuck with 'Loading..'
![image](https://user-images.githubusercontent.com/3496193/122117626-13ee5480-cdf5-11eb-8072-e6b4a281bbe2.png)

### Run `blitz -v` and paste the output here:

```
macOS Big Sur | darwin-x64 | Node: v16.3.0

blitz: 0.37.0 (global)
blitz: 0.37.0 (local)

Package manager: yarn
System:
OS: macOS 11.4
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 1022.05 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.3.0 - ~/.nvm/versions/node/v16.3.0/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v16.3.0/bin/yarn
npm: 7.15.1 - ~/.nvm/versions/node/v16.3.0/bin/npm
Watchman: Not Found
npmPackages:
@prisma/client: 2.24.1 => 2.24.1
blitz: 0.37.0 => 0.37.0
prisma: 2.24.1 => 2.24.1
react: 0.0.0-experimental-6a589ad71 => 0.0.0-experimental-6a589ad71
react-dom: 0.0.0-experimental-6a589ad71 => 0.0.0-experimental-6a589ad71
typescript: 4.1.5 => 4.1.5
```

### Please include below any other applicable logs and screenshots that show your problem:

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.