-
Notifications
You must be signed in to change notification settings - Fork 537
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
Vite-assets #22957
Open
KevinMind
wants to merge
6
commits into
master
Choose a base branch
from
vite-assets
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Vite-assets #22957
+5,481
−6,697
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KevinMind
force-pushed
the
vite-assets
branch
15 times, most recently
from
January 6, 2025 14:53
6ec5e0b
to
a33c53e
Compare
…ing make up - Replaced the locale compilation script from a shell script to a Python script (compile_locales.py) for better error handling and parallel processing. - Updated the update_assets target in Makefile-docker to use the new update_assets.py script. - Removed the obsolete compile-mo.sh script. - Introduced sync_host_files.py to streamline dependency updates and asset synchronization.
- Removed obsolete file checks and user validation from Makefile-docker. - Updated Nginx configuration to improve static file handling and added headers for better traceability. - Refactored storage management commands in the Python codebase: - Renamed `clean_storage` to `make_storage` for clarity and added a `clean` parameter. - Updated command implementations to use the new `make_storage` method. - Introduced a new system check for Nginx configurations to ensure proper file accessibility and response validation.
- Updated docker-compose.yml to mount dependencies in /data/olympia/deps for better organization. - Modified Dockerfile to set environment variables for dependency directories and ensure proper ownership. - Adjusted Makefile-docker to remove NODE_MODULES variable and streamline npm commands. - Updated documentation to reflect changes in dependency paths. - Refactored install_deps.py to clean up dependency directories and removed obsolete package.json copying logic. - Updated settings_base.py to reference new dependency paths.
- Updated docker-compose.yml to simplify volume mounts by using the current directory for all services. - Removed HOST_MOUNT and HOST_MOUNT_SOURCE environment variables from settings and entrypoint scripts, streamlining the configuration for local and production environments. - Refactored setup.py to eliminate the get_olympia_mount function, replacing it with a more straightforward approach to determine the Docker target. - Adjusted GitHub Actions workflows to remove references to the obsolete mount input, ensuring cleaner CI/CD processes. - Enhanced test cases to reflect changes in Docker configuration and environment variable handling.
5 tasks
KevinMind
force-pushed
the
vite-assets
branch
7 times, most recently
from
January 8, 2025 23:22
b69e24d
to
ff2986e
Compare
KevinMind
force-pushed
the
vite-assets
branch
2 times, most recently
from
January 8, 2025 23:47
b06ae6b
to
ec121bb
Compare
KevinMind
requested review from
a team and
eviljeff
and removed request for
a team
January 9, 2025 00:13
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relates to: mozilla/addons#2000
Important
This PR contains #22955 which should be merged first
Description
preload.js
andanalytics.js
scripts initially.Context
This PR introduces the "plumbing" needed for compiling assets with vite. It does not migrate all assets to using vite. We should split this up after landing this and we can move assets over to esm with vite.
Vite
Vite will now compile every file in
./static/js/*.js
and./static/cs/*.less
into independent bundles. Those files can then be included in our django app via the helper methodvite_asset
.For example:
This will render roughly to this:
In development mode,
vite_asset_url
will resolve to/static/bundle/<path>
where path is the original path to the url.Nginx routes
/static/bundle/
to the vite dev server which will then return the asset compiled in real time. LESS will return CSS and JS will return transpiled js.In production mode, vite will compile the assets and save them in
./site-static/assets/
and a manifest will be used to resolve the url to the file path. Nginx will mount this path and serve files directly. In production environments, like before we will serve files from a CDN.Testing
Dev mode
Run the dev/prod version of the app and make sure that:
Prod mode
Automated tests
Run the following tests which are now using vitest instead of jest
make test_setup
make run_js_tests
Checklist
#ISSUENUM
at the top of your PR to an existing open issue in the mozilla/addons repository.