datahub
datahub copied to clipboard
Datahub show takes too long to build
This is can be attributed to the following:
- Using npx create-next-app portal -e ${portalGithubRepo} command to pull repo. We should go back to cloning with GitHub since the example is already a Nextjs app.
- Portaljs example app is too big and contains unnecessary files and folders
- Building in production mode when the user runs
datahub show
. Building for production mode is slower because of the optimizations Nextjs does. - npx create-next-app command conflicts with yarn which is our default package manager. Hence two lock files are generated and the build fails
- We should create a separate repo for the portal example, and use git clone instead of
npx
. This is very fast and will run in seconds compared tonpx
which runs in minutes.
Acceptance
- [x] Set
npm
as default package manager ==> Fixed https://github.com/datopian/portal.js/pull/647 - [x] Make the example app smaller by removing unnecessary folders and files like the test folder ==> Fixed: https://github.com/datopian/portal.js/pull/648
- [ ] Use a separated repo for example, and change
npx
command to usegit clone
. - [ ] When a user runs
datahub show
, we should build and server in development mode. This is quicker - [ ] When the user runs
datahub build
, by default we build in dev mode unless the argument--production
is set. - [ ] When a user runs
datahub deploy
, then the build system can run the production build and handle deployment.
@anuveyatsu Some issues I noticed. Since the change to using npx create-next-app
in the CLI cmds, builds have been failing. From my end, and also when I tested with Leo. It's because of multiple .lock files being generated since we are using yarn as default.
I am sending a PR to change the default package manager to npm. Fixed: https://github.com/datopian/portal.js/pull/647
@anuveyatsu What are your thoughts on acceptance criteria 3 above?
WONTFIX. We aren't pursuing the CLI approach for now (datahub show
etc).