Comments (3)
Two main approaches:
- User specifies npm packages they want to add as dependencies, but if one of them is already brought by wasp, they get a warning "This package is already installed by Wasp, version a.b.c, you can just import it and use it".
Bad thing here is that they can't choose version of these packages, nor can they choose when will they be updated -> if major version of Wasp changes, versions of these packages might also likely change, and then there will be a lot of things to update at once, while user might have wanted to do these upgrades separately in smaller steps or not do them at all
Good thing is, generated code is uniform / same library is used through the whole codebase. - We use
npm aliases
which allows using multiple different versions of the same package by aliasing them. We could let user know that Wasp is already using certain package, in case they would rather use version Wasp is already using, to avoid unnecessary code being bundled into project, but if they want different version, they can do it -> we just need to ensure that wasp uses different alias for it, for example it could normally address react asreact
but if user imported another version of it (that user callsreact
) then wasp can call itreact-wasp
. This is more flexible approach but it requires more work.
Challenges:
- What if user needs lodash, but wasp is already using it, so they don't add it as dependency because Wasp is already bringing it, and then with some upgrade of Wasp, Wasp stops using lodash, and suddenly code is failing because that dependency is missing? Answer is, they should still declare it as dependency, even if Wasp is bringing it! We can just inform them that .e.g. they can use only very specific version (if going with approach 1) or that they might want to use specific version to avoid double dependency (approach 2).
- How will use specify these packages? Will there be
dependencies
JSON block they can specify? Where? In some kind of package.json? In .wasp file? What about dev dependencies vs just dependencies? What about client dependencies vs server dependencies?
from wasp.
For first iteration, it is probably best to go like this:
- Approach 1, where if user wants to add existing dependency, they have to list it, but they are forced to use specific version that Wasp says they have to use. Later, we will allow them to use any version by upgrading implementation to Approach 2, where they will get suggestion to use same version as Wasp, but will be free to use any version they want.
- Dev dependencies are not important at the moment since Wasp is completely hiding that part, so we will go just with dependencies.
- Client vs Server -> we can just put it all together for now and figure out later how to optimize that? Yes, let's do it like this for now, and when problems arrive, we will handle them.
- How will dependencies by defined -> they could go in *.wasp file, or in wasp-dependencies.json or smth like that. Ok, for now, we are going with wasp element in *.wasp file:
dependencies {=json ... json=}
, very simple, and we can improve it in the future.
from wasp.
Done with #58 .
from wasp.
Related Issues (20)
- Use `@node-rs/argon2` directly instead of `oslo/password`
- Prisma support for dbgenerated UUID field HOT 7
- Mailgun email provider not working. HOT 4
- Disallow using entities in the Wasp file HOT 2
- Reconsider how we treat and build the SDK
- No way to set neither the secure nor requireTLS attributes on the configuration for nodermailer's createTransport HOT 6
- Using native DB fields for `User` id is not supported when using Wasp auth
- Validate `tsconfig.json` and `package.json` HOT 1
- Make Auth UI Signup / Login forms more customizable HOT 3
- Allow users to store private non-source files HOT 4
- Add support for `view` and `type` blocks in Prisma schema HOT 1
- Allow implementing a custom auth provider for Wasp
- Wasp not working with node 22.5.0 (this is npm bug, not Wasp!) HOT 2
- Wasp doesn't correctly detect failed npm install and continues instead of stopping
- Replace GPT 3.5 in Mage with GPT 4o mini
- Add "Production advice" to the docs
- On wasp db migrate-dev, if TS compilation failed, we don't do actual migration
- Allow users to configure the websocket client
- Add support for multiple servers
- `useQuery` doesn't handle errors thrown from wasp operation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasp.