-
Notifications
You must be signed in to change notification settings - Fork 27
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
refactor: Use shared dropdown panel in nav #2553
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
π¦ Next.js Bundle AnalysisThis analysis was generated by the next.js bundle analysis action π€
|
Page | Size (compressed) |
---|---|
global |
207.86Β KB (π‘ +511Β B) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
Eighty-six Pages Changed Size
The following pages changed size from the code in this PR compared to its base branch:
Page | Size (compressed) | First Load |
---|---|---|
/ |
127.85Β KB (π‘ +7.76Β KB) |
335.71Β KB |
/[productSlug]/docs |
168.19Β KB (π‘ +10.2Β KB) |
376.05Β KB |
/[productSlug]/integrations |
141.97Β KB (π‘ +10.44Β KB) |
349.83Β KB |
/[productSlug]/integrations/[organizationSlug]/[integrationSlug] |
165.21Β KB (π‘ +10.14Β KB) |
373.07Β KB |
/[productSlug]/integrations/[organizationSlug]/[integrationSlug]/[integrationVersion] |
165.21Β KB (π‘ +10.14Β KB) |
373.07Β KB |
/[productSlug]/integrations/[organizationSlug]/[integrationSlug]/[integrationVersion]/components/[componentType]/[componentSlug] |
171.14Β KB (π‘ +10.26Β KB) |
379Β KB |
/[productSlug]/tutorials |
140.79Β KB (π‘ +10.56Β KB) |
348.65Β KB |
/[productSlug]/tutorials/[...tutorialSlug] |
219.15Β KB (π‘ +10.69Β KB) |
427Β KB |
/[productSlug]/tutorials/[collectionSlug] |
183.8Β KB (π‘ +10.56Β KB) |
391.66Β KB |
/_error |
112.16Β KB (π‘ +7.94Β KB) |
320.02Β KB |
/boundary |
152.35Β KB (π‘ +10.92Β KB) |
360.21Β KB |
/boundary/api-docs/[[...page]] |
169.14Β KB (π‘ +10.21Β KB) |
377Β KB |
/boundary/docs/[...page] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/boundary/install |
172.2Β KB (π‘ +10.07Β KB) |
380.06Β KB |
/certifications |
164.66Β KB (π‘ +7.72Β KB) |
372.52Β KB |
/certifications/[slug] |
165.04Β KB (π‘ +7.69Β KB) |
372.9Β KB |
/consul |
152.35Β KB (π‘ +10.92Β KB) |
360.21Β KB |
/consul/api-docs/[[...page]] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/consul/commands/[[...page]] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/consul/docs/[...page] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/consul/install |
166.14Β KB (π‘ +10.1Β KB) |
374Β KB |
/consul/install/enterprise |
166.18Β KB (π‘ +10.1Β KB) |
374.03Β KB |
/hcp |
152.34Β KB (π‘ +10.92Β KB) |
360.2Β KB |
/hcp/api-docs/consul/[[...page]] |
157.42Β KB (π‘ +10.28Β KB) |
365.27Β KB |
/hcp/api-docs/packer/[[...page]] |
157.41Β KB (π‘ +10.28Β KB) |
365.27Β KB |
/hcp/api-docs/vault-secrets/[[...page]] |
157.42Β KB (π‘ +10.28Β KB) |
365.28Β KB |
/hcp/api-docs/webhook/[[...page]] |
157.42Β KB (π‘ +10.28Β KB) |
365.27Β KB |
/hcp/docs/[...page] |
166.2Β KB (π‘ +10.15Β KB) |
374.05Β KB |
/nomad |
152.35Β KB (π‘ +10.92Β KB) |
360.21Β KB |
/nomad/api-docs/[[...page]] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/nomad/docs/[...page] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/nomad/install |
165.62Β KB (π‘ +10.23Β KB) |
373.47Β KB |
/nomad/install/enterprise |
165.6Β KB (π‘ +10.23Β KB) |
373.46Β KB |
/nomad/intro/[[...page]] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/nomad/plugins/[[...page]] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/nomad/tools/[[...page]] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/open-api-docs-preview |
161.86Β KB (π‘ +10.28Β KB) |
369.72Β KB |
/open-api-docs-preview-v2/[[...page]] |
114.82Β KB (π‘ +11.14Β KB) |
322.67Β KB |
/packer |
152.35Β KB (π‘ +10.92Β KB) |
360.21Β KB |
/packer/docs/[...page] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/packer/guides/[[...page]] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/packer/install |
165.59Β KB (π‘ +10.23Β KB) |
373.45Β KB |
/profile/account |
131.3Β KB (π‘ +10.63Β KB) |
339.16Β KB |
/profile/bookmarks |
132.33Β KB (π‘ +10.67Β KB) |
340.18Β KB |
/sentinel |
152.35Β KB (π‘ +10.92Β KB) |
360.21Β KB |
/sentinel/docs/[[...page]] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/sentinel/install |
165.59Β KB (π‘ +10.23Β KB) |
373.45Β KB |
/sentinel/intro/[[...page]] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/terraform |
152.35Β KB (π‘ +10.92Β KB) |
360.21Β KB |
/terraform/cdktf/[[...page]] |
166.21Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/terraform/cli/[[...page]] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/terraform/cloud-docs/[[...page]] |
166.21Β KB (π‘ +10.15Β KB) |
374.07Β KB |
/terraform/cloud-docs/agents/[[...page]] |
166.21Β KB (π‘ +10.15Β KB) |
374.07Β KB |
/terraform/docs/[...page] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/terraform/enterprise/[[...page]] |
166.21Β KB (π‘ +10.15Β KB) |
374.07Β KB |
/terraform/install |
165.6Β KB (π‘ +10.23Β KB) |
373.45Β KB |
/terraform/internals/[[...page]] |
166.21Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/terraform/intro/[[...page]] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/terraform/language/[[...page]] |
166.21Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/terraform/plugin/[[...page]] |
166.21Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/terraform/plugin/framework/[[...page]] |
166.21Β KB (π‘ +10.15Β KB) |
374.07Β KB |
/terraform/plugin/log/[[...page]] |
166.21Β KB (π‘ +10.15Β KB) |
374.07Β KB |
/terraform/plugin/mux/[[...page]] |
166.21Β KB (π‘ +10.15Β KB) |
374.07Β KB |
/terraform/plugin/sdkv2/[[...page]] |
166.21Β KB (π‘ +10.15Β KB) |
374.07Β KB |
/terraform/plugin/testing/[[...page]] |
166.21Β KB (π‘ +10.15Β KB) |
374.07Β KB |
/terraform/registry/[[...page]] |
166.21Β KB (π‘ +10.15Β KB) |
374.07Β KB |
/tutorials |
123.24Β KB (π‘ +7.82Β KB) |
331.1Β KB |
/tutorials/library |
147.8Β KB (π‘ +10.58Β KB) |
355.66Β KB |
/vagrant |
152.35Β KB (π‘ +10.92Β KB) |
360.21Β KB |
/vagrant/docs/[...page] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/vagrant/install |
166.1Β KB (π‘ +10.11Β KB) |
373.96Β KB |
/vagrant/install/vmware |
165.6Β KB (π‘ +10.23Β KB) |
373.46Β KB |
/vagrant/intro/[[...page]] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/vagrant/vagrant-cloud/[[...page]] |
166.21Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/validated-designs |
118.43Β KB (π‘ +7.82Β KB) |
326.28Β KB |
/validated-designs/[...slug] |
163.32Β KB (π‘ +9.84Β KB) |
371.17Β KB |
/vault |
152.35Β KB (π‘ +10.92Β KB) |
360.21Β KB |
/vault/api-docs/[[...page]] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/vault/docs/[...page] |
166.2Β KB (π‘ +10.15Β KB) |
374.05Β KB |
/vault/install |
165.59Β KB (π‘ +10.23Β KB) |
373.45Β KB |
/vault/install/enterprise |
165.6Β KB (π‘ +10.23Β KB) |
373.46Β KB |
/waypoint |
152.35Β KB (π‘ +10.92Β KB) |
360.21Β KB |
/waypoint/docs/[...page] |
166.2Β KB (π‘ +10.15Β KB) |
374.06Β KB |
/well-architected-framework |
144.48Β KB (π‘ +10.86Β KB) |
352.33Β KB |
/well-architected-framework/[...tutorialSlug] |
186.45Β KB (π‘ +9.99Β KB) |
394.3Β KB |
/well-architected-framework/[collectionSlug] |
132.67Β KB (π‘ +10.67Β KB) |
340.53Β KB |
Details
Only the gzipped size is provided here based on an expert tip.
First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link
is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.
Soon to come: Placing the shared dropdown panel in NavigationHeaderDropdownMenu's modal
- Restore original dropdown usage with new props - Add support for the product panel as a separate dropdown - Adjust types/type imports
- Replace mobile menu with panel - Hack in fixes for mobile - Fix width on tablet/desktop
21d5954
to
4542ed8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a11y looks good. Thanks @EnMod!
Move panel to the left to avoid issues with cutoff instead of changing the breakpoint
@@ -63,9 +63,13 @@ | |||
border-bottom-left-radius: 6px; | |||
border-bottom-right-radius: 6px; | |||
box-shadow: var(--token-elevation-higher-box-shadow); | |||
min-width: 252px; | |||
min-width: max-content; | |||
position: fixed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes! Good call. Addressed here:
ec41196
I had gone for fixed
initially so we could have a less-bespoke left
value to get the panel aligned. Is there anything you would suggest for a left
value than the hardcoded -216px
I now have in place?
src/components/mobile-menu-levels-generic/mobile-menu-levels-generic.module.css
Outdated
Show resolved
Hide resolved
Co-authored-by: Heat Hamilton <[email protected]>
β¦t-components (#2566) Update package-lock and include specific next version for react-components
π Relevant links
ποΈ What
This PR imports the
ProductPanel
component from@hashicorp/react-components
for use in the global nav, replacing the Products dropdown on generic pages on both desktop and mobile. This is a follow-up to #2537, utilizing the new data structure prepared in that PR.π€· Why
By using this shared panel, we can maintain a single dropdown component across both
dev-portal
andweb
, with minimal adjustments to align to the styles indev-portal
.π οΈ How
Importing a canary of the
@hashicorp/react-components
package was the first step, as this canary exports aProductPanel
(fixes from https://github.com/hashicorp/web/pull/1865, primarily) ready for external use. After that, I moved forward with implementation indev-portal
, replacing the "Products" dropdown with the new panel. This required some CSS hacking that will be documented in this PR; open to discussions on working around the need for these hacks!Finally, side panel content support was added via https://github.com/hashicorp/web/pull/1874, and other adjustments made to align with our spec.
πΈ Design Screenshots
Spec (includes side content)
Before
After
π§ͺ Testing
ProductPanel
is shown instead of the product list.ProductPanel
is shown instead of the "Main menu" and "Products" sections shown in production.π Anything else?
Looking for feedback on implementation (especially from engineers more familiar with
dev-portal
) to see if there's a more elegant way to retrofit the new component into our currentdev-portal
code π