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

refactor: react-app using hooks, hash-routes, lazy-loading, and upgraded deps #12

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

emagnier
Copy link
Contributor

@emagnier emagnier commented Jun 28, 2024

A bit of ❤️ for this project, which also serves as a showcase on romcal.js.org:

  • Lazy load calendar & locale data (for faster site loading).
  • Removal of MobX, and the use of stores in general.
  • Instead of stores, use the URL to store contextual information (calendar, locale, year, month), and React custom hooks (for retrieving and manipulate data).
  • Install react-router-dom, and use a HashRouter. FYI, GitHub Pages (where is currently hosted romcal.js.org) doesn't support BrowserRouting and custom URLs (although there is a hack).
    Screenshot 2024-06-28 at 15 16 17
  • Use hooks (less verbose than MobX, and simpler to use in React components) to access and manipulate contextual information (calendar, locale, year, month), navigate the liturgical calendar, and access romcal data (with the help or react-query, to manage the state of the data more easily).
  • Update all dependencies, except eslint (eslint-config-airbnb doesn’t support eslint v9 yet).
  • Some refactoring to improve the code (with related eslint rules):
    • Use the type keyword on imports when appropriate.
    • Generalize the use of named exports.

@emagnier emagnier changed the title refactor: react-app using hooks, hash-routes, lazy-loading, and upragded deps refactor: react-app using hooks, hash-routes, lazy-loading, and upgraded deps Jun 28, 2024
@emagnier emagnier force-pushed the react-app-refactoring branch from f415d41 to 3c3d9b2 Compare June 29, 2024 07:23
@emagnier emagnier merged commit b24a2f4 into romcal:main Sep 20, 2024
9 checks passed
@emagnier emagnier deleted the react-app-refactoring branch September 20, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant