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

Local VRT + Eliminate CSS warnings from build process #8968

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

stevector
Copy link
Contributor

@stevector stevector commented Apr 26, 2024

The volume of warnings within our build process related to CSS order is problematic. Here's an example:

warning undefined
chunk styles [mini-css-extract-plugin]
Conflicting order. Following module has been added:
 * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[1].use[2]!./src/layout/header/style.css
despite it was not able to fulfill desired ordering with these modules:
 * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[1].use[2]!./src/components/headerBody/style.css
   - couldn't fulfill desired order of chunk group(s) component---src-pages-glossary-js
   - while fulfilling desired order of chunk group(s) component---src-templates-certificationpage-js, component---src-templates-doc-js, component---src-templates-guide-js, component---src-templates-terminus-command-js, component---src-templates-terminuspage-js, component---src-templates-video-js
 * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[1].use[2]!./src/components/contributorGuest/style.css
   - couldn't fulfill desired order of chunk group(s) component---src-pages-glossary-js
   - while fulfilling desired order of chunk group(s) component---src-templates-certificationpage-js, component---src-templates-doc-js, component---src-templates-guide-js, component---src-templates-terminus-command-js, component---src-templates-terminuspage-js, component---src-templates-video-js
 * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[1].use[2]!./src/components/twitter/style.css
   - couldn't fulfill desired order of chunk group(s) component---src-pages-glossary-js
   - while fulfilling desired order of chunk group(s) component---src-templates-certificationpage-js, component---src-templates-doc-js, component---src-templates-guide-js, component---src-templates-terminus-command-js, component---src-templates-terminuspage-js, component---src-templates-video-js
 * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[1].use[2]!./src/components/github/style.css
   - couldn't fulfill desired order of chunk group(s) component---src-pages-glossary-js
   - while fulfilling desired order of chunk group(s) component---src-templates-certificationpage-js, component---src-templates-doc-js, component---src-templates-guide-js, component---src-templates-terminus-command-js, component---src-templates-terminuspage-js, component---src-templates-video-js

In the latest build of the main branch there are 16 instances of Conflicting order. Following module has been added:

It is not clear to me how serious these warnings are in and of themselves, but I think the are worth eliminating purely to get rid of the noise that makes it much harder to troubleshoot other warnings and errors with the build process when they occur.

In researching this pattern of warnings I found that the path to resolution seemed to be in ensuring that components/css files were imported in the same order across pages (and potentially imported in the order of usage within a component).

In any case, the build of this PR contains no CSS warnings. The changes in the PR fall into three categories

  • Reordering or import statements within component files to create consistency across components.
  • Abstracting usage of MDX to DRY out the codebase and reduce the likelihood that the long lists import statements in the pre-existing unDRY codebase cause conflicting ordering.
  • Removal of unused import statements. As I was cleaning up these files I was relying on VSCode's hightlighting to point out unused import statements. Some of the removed imports might have been irrelevant to the css ordering errors, but it seemed wise to remove unused imports anyway.

Adding BackstopJS Configuration

  • Updates the README with usage instructions
  • Adds 8 scenarios for VRT:
    • Pantheon Docs Homepage
    • Get Started - Landing Page
    • Release Notes - Single Entry
    • Terminus Manual - Single Page
    • Certification - Landing Page
    • Certification - Study Guide
    • Guide Layout
    • Individual Doc Page
  • backstop_data directory path added to .gitignore

Example result:
screencapture-file-Users-rachelwhitton-documentation-backstop-data-html-report-index-html-2024-05-09-12_31_10

@stevector stevector added the Site Issue or PR with the docs app stack and/or live site label Apr 26, 2024
@stevector stevector requested a review from a team as a code owner April 26, 2024 01:42
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8968-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8968-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

@stevector stevector changed the title WIP - mdx and import ordering Eliminate CSS warnings from build process Apr 26, 2024
@stevector
Copy link
Contributor Author

@mel-miller This PR is not at all urgent. Just some clean up that should get your review.

Copy link
Member

@mel-miller mel-miller left a comment

Choose a reason for hiding this comment

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

Works for me.

@stevector
Copy link
Contributor Author

Thanks @mel-miller! I'm assigning to @rachelwhitton for final review and merge.

@stevector
Copy link
Contributor Author

I just resolved the merge conflicts with main

Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8968-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

Copy link

guardrails bot commented May 9, 2024

⚠️ We detected 1 security issue in this pull request:

Vulnerable Libraries (1)
Severity Details
High pkg:npm/backstopjs@6.3.23 upgrade to: > 6.3.23

More info on how to fix Vulnerable Libraries in JavaScript.


👉 Go to the dashboard for detailed results.

📥 Happy? Share your feedback with us.

Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8968-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

@rachelwhitton rachelwhitton changed the title Eliminate CSS warnings from build process Local VRT + Eliminate CSS warnings from build process May 9, 2024
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8968-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

Copy link
Member

@rachelwhitton rachelwhitton left a comment

Choose a reason for hiding this comment

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

@stevector I added local VRT here in this PR, can you take a look? On another branch I got 8 scenarios passed (screenshot of that has been added to the description at the top of this PR), but on this branch the test result is showing me 4 passed and 4 failed

The TOC stopped working across various templates, for example:

Headers are smaller in the preview environment compared to production

screencapture-file-Users-rachelwhitton-documentation-backstop-data-html-report-index-html-2024-05-09-13_05_39

backstop.json Outdated
Comment on lines 9 to 10
"onBeforeScript": "puppet/onBefore.js",
"onReadyScript": "puppet/onReady.js",
Copy link
Member

Choose a reason for hiding this comment

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

These 2 lines were copied in from an example config file, I think we can remove?

CREATING NEW REFERENCE FILE
WARNING: script not found: /Users/rachelwhitton/documentation/backstop_data/engine_scripts/puppet/onBefore.js
Browser Console Log 0: JSHandle:BackstopTools have been installed.
Browser Console Log 0: JSHandle:BackstopTools have been installed.
Browser Console Log 0: JSHandle:BackstopTools have been installed.
Browser Console Log 0: JSHandle:BackstopTools have been installed.
Browser Console Log 0: JSHandle:BackstopTools have been installed.
Browser Console Log 0: JSHandle:BackstopTools have been installed.
Browser Console Log 0: JSHandle:BackstopTools have been installed.
Browser Console Log 0: JSHandle:BackstopTools have been installed.
WARNING: script not found: /Users/rachelwhitton/documentation/backstop_data/engine_scripts/puppet/onReady.js

@stevector stevector assigned stevector and unassigned rachelwhitton May 13, 2024
@stevector
Copy link
Contributor Author

The TOC stopped working across various templates

@rachelwhitton I'm reassigning to myself to investigate that

@stevector
Copy link
Contributor Author

@rachelwhitton I figure out why the Table of Contents stopped working.

In the PR that created Release Notes (#8802) I created the MdxWrapper component. In creating that component I tried to consolidate as many of the shortcodes passed in to mdx from other templates including this one from the old changelogs template.

That releaseHeadlines component appears to exist only to exclude headings from TOCs (because) on the old changelog you won't want every heading on the TOC, just the main headline (the month).

Anyway, I don't think we need the releaseHeadlines component at all anymore.

@stevector
Copy link
Contributor Author

I'll keep this PR assigned to myself to continue poking at VRT, at least until our 1:1 tomorrow.

@stevector
Copy link
Contributor Author

Anyway, I don't think we need the releaseHeadlines component at all anymore

🙃 No, it's used elsewhere so I'll keep the component, just remove this particular usage.

Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8968-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8968-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8968-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

@stevector stevector marked this pull request as draft May 17, 2024 18:56
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8968-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Site Issue or PR with the docs app stack and/or live site
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants