ts-type-explorer icon indicating copy to clipboard operation
ts-type-explorer copied to clipboard

Makes my remix typescript project very slow

Open jkohlin opened this issue 2 years ago • 2 comments

Type: Bug

This iextension is working fine in another project so I don't really know what the issue is with this one. But you could try cloning the Supafly remix starter at https://github.com/rphlmr/supa-fly-stack and follow all the steps to have it up and running. Here's my package.json:

{
  "name": "youwish_app-a3a1",
  "private": true,
  "sideEffects": false,
  "scripts": {
    "build": "run-s build:*",
    "build:css": "npm run generate:css -- --minify",
    "build:remix": "remix build",
    "db:prepare-migration": "prisma migrate dev --create-only --skip-seed",
    "db:deploy-migration": "prisma migrate deploy",
    "dev": "run-p dev:*",
    "dev:css": "npm run generate:css -- --watch",
    "dev:remix": "remix dev",
    "format": "prettier --write .",
    "generate:css": "tailwindcss -o ./app/styles/tailwind.css",
    "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
    "setup": "run-s setup:db setup:seed",
    "setup:db": "prisma generate && prisma migrate deploy",
    "setup:seed": "prisma db seed",
    "start": "remix-serve build",
    "start:ci": "dotenv -- remix-serve build",
    "test": "vitest",
    "test:cov": "vitest --coverage",
    "test:e2e:dev": "start-server-and-test dev http://localhost:3000 'npx cypress open'",
    "pretest:e2e:run": "npm run build",
    "test:e2e:run": "dotenv -- cross-env PORT=8811 start-server-and-test http://localhost:8811 'npx cypress run'",
    "typecheck": "tsc -b && tsc -b cypress",
    "validate": "run-p \"test -- --run\" lint typecheck test:e2e:run"
  },
  "prettier": {
    "semi": false,
    "singleQuote": true,
    "trailingComma": "all",
    "printWidth": 180,
    "tabWidth": 2,
    "useTabs": false
  },
  "dependencies": {
    "@prisma/client": "^4.6.1",
    "@remix-run/node": "^1.12.0",
    "@remix-run/react": "^1.12.0",
    "@remix-run/serve": "^1.12.0",
    "@supabase/supabase-js": "^2.2.3",
    "cookie": "^0.5.0",
    "i18next": "^21.9.1",
    "i18next-browser-languagedetector": "^6.1.5",
    "i18next-fs-backend": "^1.1.5",
    "i18next-http-backend": "^1.4.1",
    "isbot": "^3.5.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-i18next": "^11.18.5",
    "react-zorm": "^0.6.1",
    "remix-i18next": "^4.1.1",
    "remix-typedjson": "^0.1.7",
    "tailwind-merge": "^1.8.0",
    "zod": "^3.19.1"
  },
  "devDependencies": {
    "@faker-js/faker": "^7.6.0",
    "@remix-run/dev": "^1.12.0",
    "@remix-run/eslint-config": "^1.12.0",
    "@tailwindcss/aspect-ratio": "^0.4.2",
    "@tailwindcss/forms": "^0.5.3",
    "@tailwindcss/line-clamp": "^0.4.2",
    "@tailwindcss/typography": "^0.5.8",
    "@testing-library/cypress": "^8.0.3",
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^14.4.3",
    "@types/i18next-fs-backend": "^1.1.2",
    "@types/react": "^18.0.21",
    "@types/react-dom": "^18.0.6",
    "@vitejs/plugin-react": "^2.1.0",
    "@vitest/coverage-c8": "^0.24.3",
    "cross-env": "^7.0.3",
    "cypress": "^10.10.0",
    "dotenv-cli": "^6.0.0",
    "eslint": "^8.28.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-tailwindcss": "^3.7.0",
    "happy-dom": "^7.6.0",
    "msw": "^0.49.0",
    "npm-run-all": "^4.1.5",
    "prettier": "2.7.1",
    "prettier-plugin-tailwindcss": "^0.1.13",
    "prisma": "^4.6.1",
    "prisma-json-schema-generator": "^3.1.2",
    "prisma-zod-generator": "^0.2.0",
    "start-server-and-test": "^1.14.0",
    "tailwind-scrollbar": "^2.0.1",
    "tailwindcss": "^3.2.4",
    "ts-node": "^10.9.1",
    "tsconfig-paths": "^4.1.0",
    "typescript": "^4.8.4",
    "vite-tsconfig-paths": "^3.5.2",
    "vitest": "^0.24.3"
  },
  "engines": {
    "node": ">=16"
  },
  "prisma": {
    "schema": "app/database/schema.prisma",
    "seed": "ts-node --require tsconfig-paths/register app/database/seed.server.ts"
  }
}

Extension version: 0.4.0 VS Code version: Code 1.76.0 (92da9481c0904c6adfe372c12da3b7748d74bdcb, 2023-03-01T10:23:06.752Z) OS version: Darwin arm64 22.3.0 Modes: Sandboxed: No

System Info
Item Value
CPUs Apple M2 (8 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 5, 5, 4
Memory (System) 16.00GB (0.71GB free)
Process Argv --crash-reporter-id e2acb7ac-1967-400a-964f-da61ec447b62
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931cf:30280410
vshan820:30294714
vstes263:30335439
vscoreces:30445986
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vscaat:30438848
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
pynewvextcfv2:30681851
azure-dev_surveyone:30548225
pyindex848:30662994
nodejswelcome1cf:30587006
2e4cg342:30602488
pyind779:30671433
f6dab269:30613381
pythonsymbol12:30671437
a9j8j154:30646983
vscodedisable:30660115
pythonb192cf:30669361
funwalk2:30682974

jkohlin avatar Mar 12 '23 18:03 jkohlin

Hey, thanks for the extensive info! I'll try and take a look at this when I get a chance.

One suggestion in the meantime is to try and reduce the "Max Recursion Depth" setting, that might make things a little less sluggish.

Out of curiosity, is it just receiving type information that's slow, or are is all LSP affected? (hover boxes, error notices)

mxsdev avatar Mar 12 '23 18:03 mxsdev

Primarily, what made me notice the sluggishness, was when I Cmd+clicked a type or function with the intent to jump to that definition in another file, then vscode would show a "spinner" and it would take a couple of seconds before the file was opened.

jkohlin avatar Mar 13 '23 08:03 jkohlin