Skip to content

Commit

Permalink
Merge pull request #95 from springload/chore/misc-fed-chore
Browse files Browse the repository at this point in the history
Node version bump, docs update, tidyups
  • Loading branch information
liamjohnston authored Jun 11, 2024
2 parents 59a9764 + b27c6d3 commit 57cb514
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
19 changes: 19 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,25 @@ Docker (Springload)
- Copy cdhweb/settings/local_settings.py.docker-sample to cdhweb/settings/local_settings.py
- Run `docker-compose up`

Frontend (Springload)
~~~~~~~~~~~~~~~~~~~~~

The frontend uses webpack and npm.

First, make sure you're using the correct node version:

nvm use

If it tells you to install a new version, do so. Then run ``nvm use`` again.

Install dependencies:

npm install

Then to run the site in development mode locally:

npm start

Setup pre-commit hooks
~~~~~~~~~~~~~~~~~~~~~~

Expand Down
17 changes: 3 additions & 14 deletions cdhweb/static_src/components/ComponentsInit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,14 @@ import MainNavDesktop from './MainNavDesktop/MainNavDesktop.mount';
*
* There are two options for types of components: async or sync.
*
* - Async means it's a lazy-loaded component (loaded on demand).
* The import would look like,
*
* import('./MyComponent/MyComponent');
*
* That component should have a default export to mount the
* component.
*
* - `Async` means it's a lazy-loaded component (loaded on demand).
* If the component isn't on every page, then it should
* probably be Async so that users can avoid downloading it
* until necessary. See also
* https://webpack.js.org/guides/code-splitting/
*
* - Sync means it's NOT lazy loaded and it's always included
* in the main JavaScript bundle. You would import the file
* using a syntax like
*
* import { MyComponent } from './MyComponent/MyComponent';
*
* - `Sync` means it's NOT lazy loaded and it's always included
* in the main JavaScript bundle.
* If the component loads on every page, especially if it's near
* the top (like a primary nav), then it should probably be Sync.
* Sync components are included in the top-level JS bundle.
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 57cb514

Please sign in to comment.