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

Have a 'server launched' message with links to key tools #3574

Open
orta opened this issue Oct 15, 2021 · 1 comment
Open

Have a 'server launched' message with links to key tools #3574

orta opened this issue Oct 15, 2021 · 1 comment

Comments

@orta
Copy link
Contributor

orta commented Oct 15, 2021

Today booting up a site looks like:

❯ yarn rw dev
yarn run v1.22.4
$ /Users/ortatherox/dev/games/puzzle-club/node_modules/.bin/rw dev
$ /Users/ortatherox/dev/games/puzzle-club/node_modules/.bin/rw-gen-watch
$ /Users/ortatherox/dev/games/puzzle-club/node_modules/.bin/cross-env NODE_ENV=development NODE_OPTIONS=--enable-source-maps yarn nodemon --watch /Users/ortatherox/dev/games/puzzle-club/redwood.toml --exec 'yarn rw-api-server-watch'
$ /Users/ortatherox/dev/games/puzzle-club/node_modules/.bin/cross-env NODE_ENV=development RWJS_WATCH_NODE_MODULES= webpack serve --config /Users/ortatherox/dev/games/puzzle-club/node_modules/@redwoodjs/core/config/webpack.development.js
$ /Users/ortatherox/dev/games/puzzle-club/node_modules/.bin/nodemon --watch /Users/ortatherox/dev/games/puzzle-club/redwood.toml --exec 'yarn rw-api-server-watch'
api | [nodemon] 2.0.12
api | [nodemon] to restart at any time, enter `rs`
api | [nodemon] watching path(s): redwood.toml
api | [nodemon] watching extensions: js,mjs,json
api | [nodemon] starting `yarn rw-api-server-watch`
$ /Users/ortatherox/dev/games/puzzle-club/node_modules/.bin/rw-api-server-watch
gen | Generating TypeScript definitions and GraphQL schemas...
gen | 80 files generated
api | Building... Took 898 ms
api | Starting API Server... Took 6 ms
api | Listening on http://localhost:8911/
api | Importing Server Functions... 
web | 
web | warn - You have enabled the JIT engine which is currently in preview.
web | warn - Preview features are not covered by semver, may introduce breaking changes, and can change at any time.
api | /graphql 3791 ms
api | /auth 2 ms
api | /stripeWebhook 67 ms
api | /uploadPuzzle 3 ms
api | ... Imported in 3864 ms
web | assets by path static/js/*.js 5.5 MiB 25 assets
web | asset README.md 1.91 KiB [emitted] [from: public/README.md] [copied]
web | asset favicon.png 1.83 KiB [emitted] [from: public/favicon.png] [copied]
web | asset index.html 503 bytes [emitted]
web | asset robots.txt 24 bytes [emitted] [from: public/robots.txt] [copied]
web | Entrypoint app 3.2 MiB (3 MiB) = static/js/runtime-app.bundle.js 48.9 KiB static/js/app.bundle.js 3.15 MiB 2 auxiliary assets
web | orphan modules 549 KiB [orphan] 131 modules
web | runtime modules 32.8 KiB 17 modules
web | modules by path ../node_modules/ 2.5 MiB 927 modules
web | modules by path ./src/ 246 KiB
web |   modules by path ./src/components/admin/ 103 KiB 28 modules
web |   modules by path ./src/pages/ 46.7 KiB
web |     modules by path ./src/pages/Admin/ 19.6 KiB 16 modules
web |   modules by path ./src/*.css 76.4 KiB 4 modules
web |   modules by path ./src/*.tsx 10.7 KiB
web |     ./src/App.tsx 1.74 KiB [built] [code generated]
web |     ./src/Routes.tsx 8.99 KiB [built] [code generated]
web |   modules by path ./src/layouts/ 9.1 KiB
web |     ./src/layouts/AdminLayout/AdminLayout.tsx 7.91 KiB [built] [code generated]
web |     ./src/layouts/DashboardLayout/DashboardLayout.tsx 1.19 KiB [built] [code generated]
web | webpack 5.57.1 compiled successfully in 10908 ms
api | INFO [2021-10-15 08:46:20.349 +0000]: Starting a sqlite pool with 13 connections.
api |     message: "Starting a sqlite pool with 13 connections."
api |     target: "quaint::pooled"
api |     prisma: {
api |       "clientVersion": "2.30.3"
api |     }
api | INFO [2021-10-15 08:46:20.366 +0000]: Started http server on http://127.0.0.1:63981
api |     message: "Started http server on http://127.0.0.1:63981"
api |     target: "query_engine::server"
api |     prisma: {
api |       "clientVersion": "2.30.3"
api |     }
api | GET /auth?method=getToken 200 85.097 ms - 25
api | GET /auth?method=getToken 304 5.378 ms - -
api | GET /auth?method=getToken 304 4.477 ms - -
api | DEBUG [2021-10-15 08:46:20.452 +0000] (graphql-server): GraphQL execution started: __REDWOOD__AUTH_GET_CURRENT_USER
api | DEBUG [2021-10-15 08:46:20.456 +0000] (graphql-server): GraphQL execution completed: __REDWOOD__AUTH_GET_CURRENT_USER
api | POST /graphql 200 35.957 ms - 333

Which is pretty noisy sure, but the tricky thing for me personally is that the interesting info is dispersed within that body of text. Now, I get that what I'm looking at is at least 3 separate processes api, web and gen - so knowing when they are ready is a tricky problem, but what an ideal state looks like to me is that at the end there's a "ready" summary

❯ yarn rw dev
yarn run v1.22.4

# bootup stuff

Your Redwood app is ready to view in the browser:

 - ✔ Web: http://localhost:8910
 - ✔ API: http://localhost:8911
    - http://localhost:8911/graphql 3791 ms
    - http://localhost:8911/auth 2 ms
    - http://localhost:8911/stripeWebhook 67 ms
    - http://localhost:8911/uploadPuzzle 3 m

 - ✔ GraphiQL:  http://localhost:8911/graphql 
 - ✔ SDL & Prisma Watchers

And maybe include whatever http://127.0.0.1:63981 does.

The rw dev command should know how many processes there is, so an implementation could have each leave some sort of ready message in a deterministic place which is picked up by the outer process to say ready to launch.

An even more ideal state is that most of that boot up stuff is hidden unless something goes wrong, but that's a really, really tricky problem.

@thedavidprice
Copy link
Contributor

This is a great idea!

For the Redwood Core Team, I'm prioritizing this as a post-v1 discussion topic. If anyone is interested in working on this sooner, just reply and we can discuss next steps and timing.

@jtoar jtoar added next and removed hopper labels Dec 17, 2021
@jtoar jtoar removed the next label May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

3 participants