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

Make tweaks to frontend build #1483

Merged
merged 3 commits into from
Oct 7, 2024
Merged

Make tweaks to frontend build #1483

merged 3 commits into from
Oct 7, 2024

Conversation

DavidBiddle
Copy link
Contributor

@DavidBiddle DavidBiddle commented Oct 4, 2024

What problem does this pull request solve?

Trello card: None

Makes a few smallish changes to the frontend build:

  • Enable vite-ruby autobuild in development - will automatically build the frontend if any of the files in app/frontend change. We already have this on in test, it'll make developers' lives easier to have it on for local dev too.
  • Remove custom linting plugin - I don't think we were really getting much from this and remoiving it speeds up the dev server startup and hot module reloads. If we find we have a need for linting on every update, we should probably just use vite-plugin-eslint which is a more sophisticated implementation.
  • Move markdown editor icons into app/frontend icons folder - these are tied to a JS enhancement so it makes sense for them to be in the frontend folder.

See individual commit messages for details.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Has all relevant documentation been updated?

Turns on vite-ruby's autobuild feature in development. This will run the
vite build on page load if the source code has changed since the last
build.

This means developers won't have to run the frontend build manually when
checking out a new branch.
This linting plugin didn't provide much value (users can run the
frontend lint in a separate terminal) and it slowed down the vite build.

This was especially annoying when starting bin/dev, since the main idea
behind Vite is to have a fast development server.

One consequence of removing this plugin is that vitest no longer
automatically runs the linting task when running the tests. We were
relying on this in the build_and_test github workflow, so this commit
also readds the linting task to the github action.
These SVGs are used for the buttons in the markdown editor. The button
toolbar is only shown as a JS enhancement, so it makes sense that these
icons should be in the app/frontend/icons folder.
@DavidBiddle DavidBiddle force-pushed the vite-build-improvements branch from 383d8f7 to a888d7c Compare October 7, 2024 08:14
Copy link

sonarcloud bot commented Oct 7, 2024

@DavidBiddle DavidBiddle marked this pull request as ready for review October 7, 2024 08:16
@DavidBiddle DavidBiddle changed the title Vite build improvements Make tweaks to frontend build Oct 7, 2024
Copy link
Member

@lfdebrux lfdebrux left a comment

Choose a reason for hiding this comment

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

Looks good to me! Nice changes 👍

@DavidBiddle DavidBiddle merged commit f18114f into main Oct 7, 2024
5 checks passed
@DavidBiddle DavidBiddle deleted the vite-build-improvements branch October 7, 2024 09:01
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.

2 participants