-
Notifications
You must be signed in to change notification settings - Fork 5
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
Switch to local PrimeVue imports #918
Conversation
roar-dashboard-e2e Run #8752
Run Properties:
|
Project |
roar-dashboard-e2e
|
Branch Review |
ref/primevue-local-imports
|
Run status |
Passed #8752
|
Run duration | 06m 09s |
Commit |
20e7951b15: E2E Tests for PR 918 "Switch to local PrimeVue imports" from commit "20e7951b158...
|
Committer | Maximilian Oertel |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
14
|
View all changes introduced in this branch ↗︎ |
Visit the preview URL for this PR (updated for commit 20e7951): https://roar-staging--pr918-ref-primevue-local-i-0vkcqbyx.web.app (expires Tue, 05 Nov 2024 18:20:30 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 2631e9c58fd0104ecbfddd72a62245ddac467460 |
Looks good, but I am wondering what (if any) effect this will have on our Cypress component tests? For instance, here is our custom
This custom command was able to mount any of our components and their dependencies. Since we were registering (most) components globally before these PR changes, every component that mounted within Cypress had access to (most) other components, even ones that it did not need in order to perform its function. With these PR changes, each I just want to avoid a situation where we would need bespoke |
This PR shouldn’t impact the component test configuration you set up, @ksmontville. It simply moves the previously globally registered PrimeVue components to be imported directly within the individual components where they’re used. With PrimeVue components now loaded locally inside each relevant component, we can remove those global component registrations from the setup.js file you added during the initial component test setup. More generally, the code snippet you shared theoretically shouldn't be necessary, as component tests are ideally designed to test components in isolation. This works really only when the components themselves are structured in a testable way, which, as you know, isn’t quite the case here — hence, the custom mount command that you had to introduce. In other words, ideally we'd move away from needing the custom I hope that answers your question and if not, please let me know! |
Proposed changes
This PR replaces the existing global PrimeVue component imports in favor of local imports and removes unused components. The use of local component imports should improve bundle size and performance, reducing the overall load on the application. Additionally, this approach enhances maintainability by making dependencies more explicit within each component.
Whilst still too large, the application entry point is now reduced by approximately 1 MB uncompressed and 226 kB gzipped.
Types of changes
Checklist
Justification of missing checklist items
n/a
Further comments
n/a
Resolves yeatmanlab/roar-project-management#422