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

Feature: Adding SRI hash(es) for HMR script resources #1268

Merged
merged 6 commits into from
Oct 11, 2020
Merged

Feature: Adding SRI hash(es) for HMR script resources #1268

merged 6 commits into from
Oct 11, 2020

Conversation

marpme
Copy link
Contributor

@marpme marpme commented Oct 10, 2020

Changes

This PR will add SRI hashes to HMR resources for building the pre-generated HTML file.
It will also resolves some conflicting issues with the logging for the test-dev resources.

closes #1214

Testing

Build a test "snowpack-create-app" and run with with snowpack dev and got the following result:

image

Also the smoke-dev test was adjusted accordingly

Docs

In my opinion this is a very small technical feature that doesn't need documenation as there's no configuration option for it anyway.

Assumptions / Disclaimers:

This will break support for IE in general, if this is supposed to work in IE then we need to remove the SRI hash for IE builds.
It was originally build under the intention to not be supported by IE.

@marpme marpme requested a review from a team as a code owner October 10, 2020 13:52
@vercel
Copy link

vercel bot commented Oct 10, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/snowpack/a4p4yqk2c
✅ Preview: https://snowpack-git-feature-resource-integrity-for-js-files.pikapkg.vercel.app

Copy link
Owner

@FredKSchott FredKSchott left a comment

Choose a reason for hiding this comment

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

LGTM with 1 question! IE isn't supported since it has no ESM support, so we're all good there!

test-dev/dev.test.ts Show resolved Hide resolved
Copy link
Owner

@FredKSchott FredKSchott left a comment

Choose a reason for hiding this comment

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

LGTM

@FredKSchott FredKSchott merged commit f57ca8a into FredKSchott:master Oct 11, 2020
@marpme marpme deleted the feature-resource-integrity-for-js-files branch October 11, 2020 06:59
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.

Add "integrity" attribute for added hmr scripts
2 participants