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

Ensure consistency between src/client/tsconfig.json and .wasp/out/react-app/src/tsconfig.json #1057

Closed
sodic opened this issue Mar 15, 2023 · 5 comments
Labels
bug Something isn't working dx no-haskell Coding task that does not need Haskell knowledge shouldfix We should do/fix this at some point webdev

Comments

@sodic
Copy link
Contributor

sodic commented Mar 15, 2023

Moving from create-react-app to vite caused a discrepancy between our tsconfig.json files. This causes incorrect errors inside the IDE.

Specifically, IDE reports errors are not errors at all (i.e., the project compiles fine), while at the same time failing to detect some of the real errors.

One example of a false-positive is an error the IDE reports when you try to access import.meta on the frontend:

image

We should ensure that the tsconfig.json we generate for users is as similar as possible to the tsconfig.json file we use to compile their code.

This tweet may be relevant:
https://twitter.com/youyuxi/status/1636551895002255362

@sodic sodic added bug Something isn't working no-haskell Coding task that does not need Haskell knowledge dx webdev shouldfix We should do/fix this at some point labels Mar 15, 2023
@Zeko369
Copy link
Collaborator

Zeko369 commented Mar 22, 2023

... I have a lot of thoughts/notesFromWaspTesting on this and the whole "tsconfigs that dev sees and that are used to compile are different", should I wait to go over this in person this/next week or try to summarise here?

@sodic
Copy link
Contributor Author

sodic commented Mar 22, 2023

I'd be happy to have a call! One of us can then summarise it here.

@Martinsos
Copy link
Member

@sodic reminder to summarize this!

@sodic
Copy link
Contributor Author

sodic commented Apr 27, 2023

Main idea: Use the same tsconfig.json for both the IDE support and compilation. We haven't initially done this because Wasp-generated code would possibly fail user-defined compiler rules. There are several ways around this:

  • Easy and safe: Read the user's config and extend it with an include or exclude field that ignores files generated by Wasp (we can read the JSON file, parse it, add what we need, and stringify it)
  • Harder and more unclear: Bundle all Wasp-generated code and use it as a library (this will be explored within the restructuring research: Rethinking Wasp code organization #734)

@sodic
Copy link
Contributor Author

sodic commented Feb 29, 2024

With changes introduced in Wasp 0.12.0 (no separation between client and server code, a single tsconfig per project), this issue became deprecated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dx no-haskell Coding task that does not need Haskell knowledge shouldfix We should do/fix this at some point webdev
Projects
None yet
Development

No branches or pull requests

3 participants