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

Avoid preloading IE-conditional shims #4583

Merged
merged 3 commits into from
Jan 14, 2021
Merged

Conversation

aduth
Copy link
Member

@aduth aduth commented Jan 13, 2021

Why: As of version 6.1.0, Rails automatically adds preload link headers to HTTP responses for every javascript_include_tag and stylesheet_include_tag. This causes modern browsers to download these script tags. However, we include a few script tags specifically for older browsers, using Internet Explorer conditional comments. These will never actually load in modern browsers. Some browsers (Chrome) even emit warnings to this effect:

"The resource https://secure.login.gov/assets/respond.min.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally."

History:

Open questions:

  • Should we drop support for Internet Explorer 9 and below? According to @mitchellhenke , analytics reports Internet Explorer <= 9 usage represents ~0.000575% of all traffic.

Remaining tasks:

  • Unit tests, pending decision above

**Why**: Rails automatically adds `preload` link headers to HTTP responses for every `javascript_include_tag` and `stylesheet_include_tag`. This causes modern browsers to download these script tags. However, we include a few script tags specifically for older browsers, using Internet Explorer conditional comments. These will never actually load in modern browsers. Some browsers (Chrome) even emit warnings to this effect:

"The resource https://secure.login.gov/assets/respond.min.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally."
@mitchellhenke
Copy link
Contributor

Voting to drop support given USWDS does not explicitly support these version of IE: https://designsystem.digital.gov/documentation/developers/

Currently, this means that the design system version 2.0 supports the newest versions of Chrome, Firefox, Safari, and Internet Explorer 11 and up.

@@ -3,7 +3,7 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }

ruby '~> 2.6.5'

gem 'rails', '~> 6.1.0'
gem 'rails', '~> 6.1.1'
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks 😀

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

Can we add a request spec spec/requests that loads a page and inspects the headers?

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM

@aduth
Copy link
Member Author

aduth commented Jan 14, 2021

  • Should we drop support for Internet Explorer 9 and below? According to @mitchellhenke , analytics reports Internet Explorer <= 9 usage represents ~0.000575% of all traffic.

On further discussion in Slack, there's a reluctance to drop support for Internet Explorer 10 at this point. Since these shims are only actually relevant for IE8, we may still be justified in dropping them specifically. That being said, since there's a plan to follow-up with partners to better understand browser usage, it could be best to wait 'til that's completed. I'll plan to merge this as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants