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

Fix how we build generated project for production (dev deps) #897

Open
sodic opened this issue Dec 22, 2022 · 4 comments
Open

Fix how we build generated project for production (dev deps) #897

sodic opened this issue Dec 22, 2022 · 4 comments
Assignees
Labels
compiler enhancement New feature or request haskell shouldfix We should do/fix this at some point

Comments

@sodic
Copy link
Contributor

sodic commented Dec 22, 2022

Summary:

  • We have dependencies (things we need when running the code), and we have dev dependencies (things we need when writing the code, e.g., TypeScript).
  • TypeScript is specified as a dev dependency (as it should be), meaning we shouldn't install it when building Wasp for production. The same goes for nodemon, @types packages, etc. One can usually avoid installing dev dependencies by running the command npm install --production (this creates a "production build).
  • Wasp does not make this distinction, it always calls the same code which ends up calling the regular npm install, regardless of the Wasp command at hand (start, build, compile, ...).

To make Wasp production ready, we must:

  • Start treating dev dependencies differently than regular dependencies
  • Put each dependency into the appropriate category (e.g. TypeScript is a dev dependency, Express is a regular dependency)
  • Ensure our code can run without any dev dependencies (e.g., we currently don't compile TypeScript when building for production)

While we're at it, we should probably take care of #456 too.

@Martinsos Martinsos changed the title Implement proper production support Fix how we build generated project for production (dev deps) Dec 22, 2022
@sodic sodic added enhancement New feature or request haskell compiler shouldfix We should do/fix this at some point labels Jan 7, 2023
@Martinsos
Copy link
Member

Is this blocked by the restructuring, or can we go after it right now?

@sodic
Copy link
Contributor Author

sodic commented Jun 16, 2023

I'd say it's blocked.

@infomiho
Copy link
Contributor

@sodic is this now solved after 0.12.0?

@sodic
Copy link
Contributor Author

sodic commented Aug 1, 2024

I'm not sure, some parts of it may be fixed, but I think not (I think we still treat them the same way when building for production).

Most (if not all) points are still applicable, I'd say.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler enhancement New feature or request haskell shouldfix We should do/fix this at some point
Projects
None yet
Development

No branches or pull requests

3 participants