Add Vite for javascript assets
What does this MR do and why?
This MR adds vite as a frontend runner for javascript assets instead of webpack in development mode.
This is intended only for developer experience evaluation purposes. That's why it's behind a feature flag.
This MR fixes the issue with the CNG deployments from Add Vite for javascript assets in development mode (!115469 - merged).
How to test locally
- Run
echo "Feature.enable(:vite)" | gdk rails c
- Launch
bundle exec vite dev
- Restart GDK
Issues with local vite server
Current configuration assumes you've set up gdk.test
domain on a specific IP address. In case you're running it on localhost
please change config/vite.json
development host to localhost
.
How to build
Make sure you have 10GB of RAM free.
- Run
NODE_OPTIONS="--max_old_space_size=10240" bundle exec vite build
Merge request reports
Activity
changed milestone to %16.3
assigned to @slashmanov
removed workflowpost-deploy-db-production label
removed missed:16.0 label
removed missed:16.1 label
removed missed:16.2 label
removed pipeline:mr-approved label
removed pipeline:run-as-if-jh label
added 1 commit
- 85b3928b - Add Vite for javascript assets in development mode
added pipeline:run-as-if-jh label
mentioned in merge request !115469 (merged)
added 1 commit
- 534188d6 - Add Vite for javascript assets in development mode
- Resolved by Jennifer Li
@markrian this version is exactly the same as the !115469 (merged) except for these changes:
- Removed
VITE_RUBY_SKIP_ASSETS_PRECOMPILE_EXTENSION
env from the.gitlab/ci/frontend.gitlab-ci.yml
- Added
ENV['VITE_RUBY_SKIP_ASSETS_PRECOMPILE_EXTENSION'] = 'true'
toconfig/application.rb
- Fixed wrong milestone and owner group in the
config/feature_flags/development/vite.yml
The reasoning behind removing the env from the CI config is that setting env in the
config/application.rb
file should always prevent us from compiling assets with Vite whichever way we chose to compile GitLab. Sincevite_ruby
reads the env during gem loading it is the only place I could think of where to put this variable. So in case that's not sufficient the pipeline in this MR will always fail.Could you please review this when you have time?
Edited by Stanislav Lashmanov - Removed
requested review from @markrian
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@e0ac3fa0
4 Warnings This merge request is quite big (1014 lines changed), please consider splitting it into multiple merge requests. 8100f574: Commits that change 30 or more lines across at least 3 files should describe these changes in the commit body. For more information, take a look at our Commit message guidelines. featureaddition and featureenhancement merge requests normally have a documentation change. Consider adding a documentation update or confirming the documentation plan with the Technical Writer counterpart.
For more information, see:
- The Handbook page on merge request types.
- The definition of done documentation.
This merge request has introduced duplicated yarn dependencies. 1 Message CHANGELOG missing: If you want to create a changelog entry for GitLab FOSS, add the
Changelog
trailer to the commit message you want to add to the changelog.If you want to create a changelog entry for GitLab EE, also add the
EE: true
trailer to your commit message.If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.
Duplicate yarn dependencies
The following dependencies should be de-duplicated:
Package "postcss" wants ^8.1.10 and could get 8.4.28, but got 8.4.27
Package "postcss" wants ^8.2.1 and could get 8.4.28, but got 8.4.27
Package "postcss" wants ^8.4.14 and could get 8.4.28, but got 8.4.27
Package "postcss" wants ^8.4.27 and could get 8.4.28, but got 8.4.27
Please run the following command and commit the changes to
yarn.lock
:node_modules/.bin/yarn-deduplicate --strategy fewer yarn.lock \ && yarn install
Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Eugie Limpin (
@eugielimpin
) (UTC+8, 4 hours ahead of@slashmanov
)Doug Stull (
@dstull
) (UTC-4, 8 hours behind@slashmanov
)frontend Minahil Nichols (
@minahilnichols
) (UTC-4, 8 hours behind@slashmanov
)Himanshu Kapoor (
@himkp
) (UTC+7, 3 hours ahead of@slashmanov
)groupimport and integrate (frontend) Justin Ho (
@justin_ho
) (UTC+7, 3 hours ahead of@slashmanov
)Maintainer review is optional for groupimport and integrate (frontend) Please check reviewer's status!
Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
Rubygems
This merge request adds, or changes a Rubygems dependency. Please review the Gemfile guidelines.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Dangerremoved groupfoundations label
added groupcode review label
added devopscreate label and removed devopsmanage label
added 1 commit
- bff38a2a - Add Vite for javascript assets in development mode
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@dcc04114
added 1 commit
- 902baba7 - Add Vite for javascript assets in development mode
added 1 commit
- 2d298038 - Add Vite for javascript assets in development mode
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@e72a9833
Bundle size analysis [beta]
This compares changes in bundle size for entry points between the commits 8db8c5d5 and 8100f574
Special assetsEntrypoint / Name Size before Size after Diff Diff in percent average 4.17 MB 4.17 MB - 0.0 % mainChunk 3.02 MB 3.02 MB - 0.0 %
Note: We do not have exact data for 8db8c5d5. So we have used data from: 8637b304.
The intended commit has no webpack pipeline, so we chose the last commit with one before it.Please look at the full report for more details
Read more about how this report works.
Generated by
DangerAllure report
allure-report-publisher
generated test report!e2e-test-on-gdk:
test report for 8100f574expand test summary
+-----------------------------------------------------------------------+ | suites summary | +------------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +------------------+--------+--------+---------+-------+-------+--------+ | Create | 46 | 0 | 1 | 2 | 47 | ❗ | | Plan | 51 | 0 | 0 | 0 | 51 | ✅ | | Govern | 36 | 0 | 0 | 0 | 36 | ✅ | | Monitor | 4 | 0 | 0 | 0 | 4 | ✅ | | Data Stores | 22 | 0 | 0 | 0 | 22 | ✅ | | Verify | 8 | 0 | 0 | 0 | 8 | ✅ | | Framework sanity | 0 | 0 | 1 | 0 | 1 | ➖ | | Package | 0 | 0 | 1 | 0 | 1 | ➖ | | Manage | 13 | 0 | 1 | 0 | 14 | ✅ | +------------------+--------+--------+---------+-------+-------+--------+ | Total | 180 | 0 | 4 | 2 | 184 | ❗ | +------------------+--------+--------+---------+-------+-------+--------+
e2e-review-qa:
test report for 8100f574expand test summary
+-----------------------------------------------------------------------+ | suites summary | +------------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +------------------+--------+--------+---------+-------+-------+--------+ | Monitor | 4 | 0 | 0 | 0 | 4 | ✅ | | Manage | 1 | 0 | 0 | 0 | 1 | ✅ | | Govern | 2 | 0 | 0 | 0 | 2 | ✅ | | Create | 8 | 0 | 1 | 0 | 9 | ✅ | | Data Stores | 2 | 0 | 0 | 0 | 2 | ✅ | | Package | 0 | 0 | 1 | 0 | 1 | ➖ | | Plan | 3 | 0 | 1 | 0 | 4 | ✅ | | Framework sanity | 0 | 0 | 1 | 0 | 1 | ➖ | +------------------+--------+--------+---------+-------+-------+--------+ | Total | 20 | 0 | 4 | 0 | 24 | ✅ | +------------------+--------+--------+---------+-------+-------+--------+
e2e-package-and-test:
test report for 8100f574expand test summary
+-----------------------------------------------------------------------+ | suites summary | +------------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +------------------+--------+--------+---------+-------+-------+--------+ | Plan | 78 | 0 | 3 | 0 | 81 | ✅ | | Create | 134 | 0 | 23 | 13 | 157 | ❗ | | Manage | 34 | 0 | 2 | 0 | 36 | ✅ | | Data Stores | 34 | 0 | 0 | 0 | 34 | ✅ | | Govern | 55 | 0 | 0 | 2 | 55 | ❗ | | Package | 0 | 34 | 4 | 0 | 38 | ❌ | | Verify | 41 | 6 | 5 | 0 | 52 | ❌ | | Fulfillment | 2 | 0 | 24 | 0 | 26 | ✅ | | Configure | 0 | 0 | 3 | 0 | 3 | ➖ | | Secure | 2 | 0 | 4 | 0 | 6 | ✅ | | ModelOps | 0 | 0 | 2 | 0 | 2 | ➖ | | Monitor | 8 | 0 | 2 | 0 | 10 | ✅ | | Release | 3 | 3 | 0 | 0 | 6 | ❌ | | Framework sanity | 0 | 0 | 1 | 0 | 1 | ➖ | | Analytics | 2 | 0 | 0 | 0 | 2 | ✅ | | Growth | 0 | 0 | 2 | 0 | 2 | ➖ | +------------------+--------+--------+---------+-------+-------+--------+ | Total | 393 | 43 | 75 | 15 | 511 | ❌ | +------------------+--------+--------+---------+-------+-------+--------+
changed milestone to %16.4
added 1 commit
- 814b86e9 - Add Vite for javascript assets in development mode
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@ce1cdd77
added 172 commits
-
814b86e9...cd8b0772 - 171 commits from branch
master
- 5063ba98 - Add Vite for javascript assets in development mode
-
814b86e9...cd8b0772 - 171 commits from branch
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@b827aef1
- Resolved by Costel Maxim
Dependency change review report
This automation is under testing, please leave your feedback in the issue.New Dependency: dry-cli (1.0.0) Location:
Gemfile.lock
Checks passed: 6/6
-
️ Latest version: 1.0.0 released on: 2022-11-05. URL: https://rubygems.org/gems/dry-cli -
Latest version is in use. -
Total downloads: 3301947 -
Reverse dependencies: 75 -
Releases in last 4 quarters: 1 -
Latest version age (months): 9 -
GitHub project not archived
New Dependency: vite_rails (3.0.15) Location:
Gemfile.lock
Checks passed: 6/6
-
️ Latest version: 3.0.15 released on: 2023-06-19. URL: https://rubygems.org/gems/vite_rails -
Latest version is in use. -
Total downloads: 1917216 -
Reverse dependencies: 1 -
Releases in last 4 quarters: 5 -
Latest version age (months): 2 -
GitHub project not archived
New Dependency: vite_ruby (3.3.4) Location:
Gemfile.lock
New dependency identified, pinging @gitlab-com/gl-security/appsec for review. For review guidelines refer handbook page. Hi Appsec, please resolve this thread once review is completed.Checks passed: 6/6
-
️ Latest version: 3.3.4 released on: 2023-06-27. URL: https://rubygems.org/gems/vite_ruby -
Latest version is in use. -
Total downloads: 2052476 -
Reverse dependencies: 6 -
Releases in last 4 quarters: 23 -
Latest version age (months): 1 -
GitHub project not archived
-
- Resolved by Stanislav Lashmanov
- Resolved by Jennifer Li
removed review request for @markrian
@markrian
, thanks for approving this merge request.This is the first time the merge request has been approved. To ensure full test coverage, a new pipeline will be started shortly.
For more info, please refer to the following links:
added pipeline:mr-approved label
added 1417 commits
-
5063ba98...4e354984 - 1416 commits from branch
master
- 1b396731 - Add Vite for javascript assets in development mode
-
5063ba98...4e354984 - 1416 commits from branch
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@74df879b
requested review from @jennli
added 416 commits
-
1b396731...6229da44 - 415 commits from branch
master
- 8100f574 - Add Vite for javascript assets in development mode
-
1b396731...6229da44 - 415 commits from branch
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@d22c813e
enabled an automatic merge when the pipeline for b0aaa95e succeeds
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@b0aaa95e
mentioned in commit aa04f862
added workflowstaging-canary label
added workflowcanary label and removed workflowstaging-canary label
mentioned in issue gitlab-org/frontend/rfcs#106
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
added workflowpost-deploy-db-staging label and removed workflowproduction label
added workflowpost-deploy-db-production label and removed workflowpost-deploy-db-staging label
added releasedpublished label and removed releasedcandidate label
mentioned in commit 0b9cdf25
mentioned in merge request !135022 (merged)
mentioned in commit 579550dd
mentioned in issue gitlab-org/quality/triage-reports#15304 (closed)
Is there an issue or epic where I can follow progress? I just wanted to highlight that GCK uses webpack, so we may need to prepare it to support this new tool as well.