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

Minify production build of patterns.hypothes.is website #1806

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

robertknight
Copy link
Member

  • Minify the pattern library build using Terser. The Rollup config changes were copied from the hypothesis/client repo.
  • Add docker and run-docker make targets to facilitate local testing of the Docker build

Testing:

  1. Run make docker
  2. Run make run-docker
  3. Navigate to http://localhost:5002 in a browser

@echo "make sure Make sure that the formatter, linter, tests, etc all pass"
@echo "make clean Delete development artefacts (cached files, "
@echo " dependencies, etc)"
@echo "make test Run the unit tests once"
Copy link
Member Author

Choose a reason for hiding this comment

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

I sorted the entries after make help alphabetically to make it easier to figure out where to slot any new entries in.

@git archive --format=tar.gz HEAD | docker build -t hypothesis/frontend-shared:latest -

# Run Docker container. Publish to port 5002 on the host to avoid a conflict
# with other Hypothesis projects.
Copy link
Member Author

Choose a reason for hiding this comment

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

h's WebSocket server uses port 5001.

@robertknight robertknight requested a review from acelaya November 29, 2024 17:01
@acelaya
Copy link
Contributor

acelaya commented Dec 2, 2024

I think make format needs to be run here.

@robertknight robertknight force-pushed the minify-prod-pattern-lib-build branch from 10ade1b to be09ae8 Compare December 2, 2024 14:49
Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (0555694) to head (5168a37).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1806   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           68        68           
  Lines         1234      1234           
  Branches       468       468           
=========================================
  Hits          1234      1234           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

The changes to rollup.config.js were copied from the hypothesis/client repo.
This enables testing the website locally as follows:

1. Run `make docker`
2. Run `make run-docker`
3. Navigate to http://localhost:5002
@robertknight robertknight force-pushed the minify-prod-pattern-lib-build branch from be09ae8 to 5168a37 Compare December 2, 2024 14:56
@robertknight robertknight merged commit 10d70bc into main Dec 2, 2024
4 checks passed
@robertknight robertknight deleted the minify-prod-pattern-lib-build branch December 2, 2024 15: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