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)
- Improve our docs on `resolveProjectPath` helper HOT 4
- Adding a password strength meter in Auth UI HOT 1
- Document how to use external services/servers in Wasp
- Allow customizing `html` element
- Discord Invite Link Broken HOT 3
- Find a way to avoid getting 401 from server when user is not logged in
- Implement `wasp build start` command that runs output of `wasp build`
- Improve CRUD full-stack type-safety
- We should improve our env variable names
- Improve our OAuth docs to better explain the `scope` property
- Create a place to share solutions for common problems HOT 1
- Allow customisation of OAuth redirect screen
- hGetContents: invalid argument HOT 3
- Document our environment variables HOT 1
- Drop mention of `nvm` from "Quick Start" docs
- Improve error message when root component takes no arguments
- Fix docs on calling queries and actions on the server HOT 3
- Add "SEO" section in our docs HOT 2
- Document passing of client env vars to `wasp deploy fly deploy`?
- resource exhausted (Too many open files) HOT 6
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.