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

USWDS-Site - USWDS 3.0 Migration Page #1529

Merged
merged 68 commits into from
Apr 27, 2022
Merged

USWDS-Site - USWDS 3.0 Migration Page #1529

merged 68 commits into from
Apr 27, 2022

Conversation

mahoneycm
Copy link
Contributor

@mahoneycm mahoneycm commented Apr 18, 2022

Preview

USWDS 3.0 Migration →

Description

Creates USWDS 3.0 migration guide based on this mockup

Because of having to use the usa-accordion component as well as code blocks with strikethrough, HTML syntax is used throughout the markdown

Additional information

Heading Level 4 tags appear in all caps

Heading level 3 on top, Heading level 4 below
image

Before you hit Submit, make sure you’ve done whichever of these applies to you:

  • Follow the 18F Front End Coding Style Guide and Accessibility Guide.
  • Run npm test and make sure the tests for the files you have changed have passed.
  • Run your code through HTML_CodeSniffer and make sure it’s error free.
  • Title your pull request using this format: [Website] - [UI component]: Brief statement describing what this pull request solves.

mikki-stacey and others added 11 commits April 11, 2022 12:51
I updated lead text to reflect new content guidance.

Upon release of 3.0, devs will need to update all three links on this page (1 for the new code and 2 for new design assets).

The version number under the "code" heading needs to be updated to "3.0."

The text of both links under the "design assets" heading each need to be updated:
–to reference the new version number
–to reflect the new file size of the assets
I've revised the summary text  under "Developers," "Designers," and "USWDS project wiki."

As we prepare for the release of 3.0, the following issue is outstanding:

From this page, we link to our project wiki, in which v1 is referenced under current initiatives.
We should remove this link (at least temporarily, though maybe permanently since we aren't updating this content and it's weird it's presented the same as our user guidance). If we keep the link, we should update the wiki.
Revised to clarify 3.0 does not support IE11.
Revised so the notice box references v 3 instead of 2.

The following is an outstanding issue on/related to this page:

–Under "USWDS for designers" we need to provide downloads for the new assets. The downloads for the old assets need to be moved to appear under "Retired design files."

–In the second paragraph under "USWDS for designers," we link to a GitHub repo. This repo has, what I assume to be a change log that will need to be updated to reflect any changes in 3.0.
-Small change in line 80 to reflect new instructions. 
-Please also review Step 4 table for path information to ensure there should be no changes.
-Line 134 change from IE in example to Firefox
Line 29 Update from USWDS 2 to USWDS 3
Line 70: Updated file import path
@mahoneycm mahoneycm changed the base branch from main to develop April 18, 2022 17:30
@bonnieAcameron
Copy link
Contributor

bonnieAcameron commented Apr 18, 2022

Notes:

  • Can we auto-collapse all the accordions?
  • Remove yellow highlighting in text
  • Can we shorten the space between the heading and the code box at NEW/OLD? It's hard to tell if they belong together
    CBB76EF4-CAB4-4AC1-B09B-3B1E33BB6B56

@bonnieAcameron
Copy link
Contributor

bonnieAcameron commented Apr 19, 2022

I also see that the "menu" at the top of the page doesn't align with the content any longer. I think we've removed "update to USWDS Compile" and it should probably be instead (as Matt suggested in the doc):

  1. [Optional] Optimize your installation with component packages

2174EA56-E151-4B6E-9599-BA2094E0077C

SUMMARY OF REQUESTED CHANGES:

  • Update the anchored links by replacing # 7 with "optimize your installation"
  • Add Step 7 to "optimize your installation" in the H1 as Matt suggested in the google doc

@thisisdano
Copy link
Member

OK, I'm going to be working on this today — thanks for your work getting it built out!

mahoneycm and others added 6 commits April 22, 2022 13:52
3.0 Migration guide - convert accordion to markdown
Co-authored-by: Amy Leadem <93996430+amyleadem@users.noreply.github.com>
Co-authored-by: Amy Leadem <93996430+amyleadem@users.noreply.github.com>
Comment on lines 387 to 420
<li>Search for a line like <strong>const USWDS = "node_modules/uswds/dist"</strong> in your Gulp setup. This indicates that you're using the Gulp setup we distributed as USWDS Gulp.</li>
<li>
Update the USWDS <strong>const</strong> to the updated uswds package location
<p><strong>Old</strong></p>
<code>const USWDS = "node_modules/uswds/dist";</code>
<p><strong>New</strong></p>
<code>const USWDS = "node_modules/@uswds/uswds";</code>
<br>
</li>
<li>
Search for <strong>includePaths</strong> in your project's Gulp files. The paths in this list are where the Sass compiler looks for your source files. In USWDS 3.0
<p><strong>Old</strong></p>
<pre><code>.pipe(
sass({
includePaths: [
PROJECT_SASS_SRC,
`${USWDS}/scss`,
`${USWDS}/scss/packages`,
],
})
)</code></pre>
<p><strong>New</strong></p>
<pre><code>.pipe(
sass({
includePaths: [
PROJECT_SASS_SRC,
`${USWDS},
`${USWDS}/packages`,
],
})
)</code></pre>
</li>
<li>Recompile your Sass as usual. When it compiles, it is now using USWDS 3.0!</li>
</ol>
Copy link
Contributor

@amyleadem amyleadem Apr 25, 2022

Choose a reason for hiding this comment

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

Expanding on my earlier comment first made here.

I did a fresh install of USWDS Gulp on a test project and found the instructions didn't match the current standard USWDS Gulp references. Working on the assumption that many users will be using the defaults from USWDS Gulp, I updated the instructions in this section.

@mejiaj @thisisdano can you confirm that these updates are required/advisable?
Additionally, is the +/- diff a clear way to communicate the changes?

⚠️ I did a couple of things to shorten the code to minimize confusing line breaks, like using only short code snippets and not using the larger .site-terminal styles. If either of these techniques are problematic, please let me know. I am very open to suggestions.

⚠️ I couldn't add suggested code in this comment because it struggled with the nested code blocks, but I included a screenshot and proposed update below the screenshot for reference. If this generally looks good from the dev side, I can push up my local branch for copyediting/fine-tuning.

Snapshot from federalist:

image

Code update:

  1. Search for a line like const uswds = require("./node_modules/uswds-gulp/config/uswds"); or const uswds = "node_modules/uswds/dist" in your Gulp setup. This indicates that you're using the Gulp setup we distributed as USWDS Gulp.
  2. Update the USWDS const elements to the updated USWDS package location:
- const pkg = require("./node_modules/uswds/package.json");
+ const pkg = require("./node_modules/@uswds/uswds/package.json"); 
- const uswds = require("./node_modules/uswds-gulp/config/uswds"); 
+ const uswds = "node_modules/@uswds/uswds";
  1. Search for references to ${uswds} in the includePaths and gulp.src() found in your project’s Gulp files. These paths tell the Sass compiler where to look for USWDS source files.

    Some of our file directories have moved in USWDS 3.0, and it is necessary to point Gulp to the correct location inside node_modules/@uswds/uswds. Below are snippets from the standard USWDS Gulp references and their necessary updates:

    ...
    - gulp.src(`${uswds}/scss/theme/**/**`)
    + gulp.src(`${uswds}/dist/theme/**/**`)
    ...
    - gulp.src(`${uswds}/fonts/**/**`)
    + gulp.src(`${uswds}/dist/fonts/**/**`)
    ...
    - gulp.src(`${uswds}/img/**/**`)
    + gulp.src(`${uswds}/dist/img/**/**`)
    ...
    - gulp.src(`${uswds}/js/**/**`)
    + gulp.src(`${uswds}/dist/js/**/**`)
    ...
      includePaths: [
       PROJECT_SASS_SRC,
    -     `${uswds}/scss`,
    +     `${uswds}/dist/scss`,
    -     `${uswds}/scss/packages`,
    +     `${uswds}/packages`,
      ],
  2. Recompile your Sass as usual and check that your files compiled as expected. When it compiles successfully, it is now using USWDS 3.0!

Copy link
Member

Choose a reason for hiding this comment

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

Done!

Comment on lines 442 to 454

{:.site-terminal}
```js
/* gulpfile.js */

const uswds = require("@uswds/compile");

/**
* USWDS version
*/

uswds.settings.version = 3;
```
Copy link
Contributor

@amyleadem amyleadem Apr 25, 2022

Choose a reason for hiding this comment

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

@thisisdano @mejiaj Here's a first pass for USWDS compile. Working on standardizing the instruction format to match USWDS Gulp

  1. Search for const uswds = require("@uswds/compile"); in your Gulp setup. This indicates that you're using the Gulp setup we distributed as USWDS Compile.
  2. Update your gulpfile.js to file to include uswds.settings.version = 3;. This setting manages the default USWDS source paths and will point Gulp to the new USWDS 3.0 package locations.
    /* gulpfile.js */
    
    const uswds = require("@uswds/compile");
    
    /**
     * USWDS version
     */
    
    uswds.settings.version = 3;
  3. Recompile your Sass as usual and check that your files compiled as expected. When it compiles successfully, it is now using USWDS 3.0!

Copy link
Member

Choose a reason for hiding this comment

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

Done!

@thisisdano thisisdano marked this pull request as ready for review April 27, 2022 03:08
@thisisdano thisisdano merged commit 5db5368 into develop Apr 27, 2022
@thisisdano thisisdano deleted the cm-migrate-3.0 branch April 27, 2022 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants