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

migrate frontend to docusaurus #9014

Merged
merged 38 commits into from
Jun 17, 2023
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
34bdb6d
delete loads of really important stuff that we definitely need
chris48s Mar 19, 2023
b293065
v basic MVP smoosh docusaurus PoC into repo
chris48s Mar 20, 2023
20aea04
TODO
chris48s Mar 20, 2023
e6f9b0d
delete more really important stuff
chris48s Mar 20, 2023
1cc9572
TODO
chris48s Mar 20, 2023
b8cb4d8
tidyup: use run-s
chris48s Mar 20, 2023
abf4bd4
don't redirect images used in frontend to raster proxy
chris48s Mar 20, 2023
87f5b97
fix routing
chris48s Mar 20, 2023
d27370f
preserve the /endpoint link
chris48s Mar 20, 2023
2d5fd7f
delete the blog (for now)
chris48s Mar 20, 2023
ece6472
content edits
chris48s Mar 20, 2023
77b0343
appease the lint gods
chris48s Mar 20, 2023
235d2b0
update danger rules
chris48s Mar 20, 2023
1ecf949
remove placeholder
chris48s Mar 20, 2023
956d617
cypress tests
chris48s Mar 23, 2023
ef74cbb
dockerhub --> ghcr
chris48s Mar 23, 2023
3fe9470
Revert "dockerhub --> ghcr"
chris48s Mar 26, 2023
65881f1
Merge branch 'master' into gatsby-docusaurus
chris48s Apr 11, 2023
e0004d5
downgrade lockfile format
chris48s Apr 11, 2023
d659e91
implement defs/BASE_URL
chris48s Apr 11, 2023
c99fdb2
fix e2e build
chris48s Apr 11, 2023
b38bd85
actually fix cypress tests
chris48s Apr 12, 2023
df46828
always run cypress tests on build
chris48s Apr 12, 2023
f1243e3
this never worked
chris48s Apr 12, 2023
19a2080
add command for docusaurus:clear
chris48s Apr 12, 2023
2931df6
delete more code we don't need any more
chris48s Apr 12, 2023
2e2ee69
update ESLint/prettier config
chris48s Apr 12, 2023
3adb7bd
delete unsused exports
chris48s Apr 13, 2023
1cd61cd
documentation updates
chris48s Apr 13, 2023
424c411
delete a fairly large chunk of our dependency tree
chris48s Apr 13, 2023
25aab60
Merge branch 'master' into gatsby-docusaurus
chris48s Apr 15, 2023
fbf50a9
allow base_url as build arg to Dockerfile
chris48s Apr 15, 2023
bd43d07
fixup dockerfile
chris48s Apr 15, 2023
c4288f6
work out base url at runtime if not set
chris48s Apr 15, 2023
2accfd2
remove gatsby monorepo from closebot
chris48s Apr 16, 2023
b2ff593
rename HomepageFeatures to homepage-features
chris48s Jun 10, 2023
ab3785b
Merge branch 'master' into gatsby-docusaurus
chris48s Jun 10, 2023
5d6ff7e
Merge branch 'master' into gatsby-docusaurus
chris48s Jun 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
implement defs/BASE_URL
  • Loading branch information
chris48s committed Apr 11, 2023
commit d659e91d8cb6be03bc4606420ad40758b2858022
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"coverage:test:integration": "c8 npm run test:integration",
"coverage:test:services": "c8 npm run test:services",
"coverage:clean": "rimraf .nyc_output coverage",
"precoverage:test": "run-s --silent coverage:clean defs",
"precoverage:test": "cross-env BASE_URL=http://localhost:8080 run-s --silent coverage:clean defs",
"coverage:test": "run-s --silent --continue-on-error coverage:test:core coverage:test:package coverage:test:entrypoint coverage:test:integration",
"coverage:report:generate": "c8 report",
"coverage:report:open": "open-cli coverage/lcov-report/index.html",
Expand All @@ -95,13 +95,13 @@
"test:services:pr:prepare": "node core/service-test-runner/pull-request-services-cli.js > pull-request-services.log",
"test:services:pr:run": "cross-env NODE_CONFIG_ENV=test mocha core/service-test-runner/cli.js --stdin < pull-request-services.log",
"test:services:pr": "run-s --silent test:services:pr:prepare test:services:pr:run",
"pretest": "run-s --silent defs",
"pretest": "cross-env BASE_URL=http://localhost:8080 run-s --silent defs",
"test": "run-s --silent --continue-on-error lint test:package test:core test:entrypoint check-types:package prettier:check",
"check-types:package": "tsd badge-maker",
"depcheck": "check-node-version --node \">= 16.0\"",
"prebuild": "run-s --silent depcheck",
"defs": "echo 'TODO: https://github.com/badges/shields/pull/8966'",
"build": "rimraf public && run-s defs docusaurus:build",
"defs": "node scripts/export-openapi-cli.js",
"build": "rimraf public && cross-env BASE_URL=https://img.shields.io run-s defs docusaurus:build",
"heroku-postbuild": "run-s --silent build",
"start:server:prod": "node server",
"now-start": "npm run start:server:prod",
Expand All @@ -110,7 +110,7 @@
"debug:server": "cross-env NODE_CONFIG_ENV=development nodemon --inspect server.js 8080",
"profile:server": "cross-env NODE_CONFIG_ENV=development node --prof server 8080",
"benchmark:badge": "cross-env NODE_CONFIG_ENV=test node scripts/benchmark-performance.js --iterations 10100 | node scripts/capture-timings.js --warmup-iterations 100",
"prestart": "run-s --silent depcheck defs",
"prestart": "cross-env BASE_URL=http://localhost:8080 run-s --silent depcheck defs",
"start": "concurrently --names server,frontend \"npm run start:server\" \"npm run docusaurus:start\"",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you run the built version of the docs (i.e: npm run build and serve it from scoutcamp), the website performs really well because it is just serving static HTML files.

The dev server (with hot reload when you change the files and all that jazz) is a bit of a resource hog, especially the first time you start it. It does seem to get a bit better once docusaurus has cached some stuff, but your first experience of running npm start is likely to be a bit sluggish. I think the fact we have over 600 pages doesn't help but in general this is an acknowledged issue: facebook/docusaurus#4765 It is not great dev experience, but I can live with it. Its not an issue that will affect production. This was kinda true of gatsby too, but docusaurus is way worse. If it turns into a big pain point, we could consider having 2 variants of the dev server:

  • A "I want to work on the website" command (that runs docusaurus start so you get hot reloads for the frontend) and
  • A "I want to work on the badge server" command (that runs npm run build and serves it from scoutcamp)

For now I am going to ignore this issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other possibility is that it might be possible to tweak webpack or use a different bundler. I don't think its a blocker though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thinking this through a bit more..

If we think the performance of the webpack devserver is terrible, I think changing the default behaviour of npm start in dev to just compile the frontend and serve it with no watch on the frontend (but keep nodemon doing hot reloads for the backend) does not actually lose us very much. I've deleted almost all of the frontend code so there is less to watch :) I think it would be useful to get another opinion on the dev experience here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think i'll have time today but i'll pull your branch down locally and give it a test drive soon

"e2e": "start-server-and-test start http://localhost:3000 test:e2e",
"e2e-on-build": "cross-env CYPRESS_baseUrl=http://localhost:8080 start-server-and-test start:server:e2e-on-build http://localhost:8080 test:e2e",
Expand Down