Skip to content

Adding SRI support to codeorigin.jquery.com #22

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

Closed
wants to merge 4 commits into from
Closed

Adding SRI support to codeorigin.jquery.com #22

wants to merge 4 commits into from

Conversation

jmervine
Copy link
Contributor

@jmervine jmervine commented Feb 1, 2016

Hello!

Per the discussions on #20, I'm adding SRI generation and include the class and data-hash attributes here in jquery/codeorigin.jquery.com. The changes here should have no functional impact on the site, but are required for implementation. I'm new to both the *.jquery.com setup and Wordpress itself, however based on what I'm seeing, it looks like the rest will need to be implemented in github.com/jquery/jquery-wp-content inside themes/codeorigin.jquery.com. If I am incorrect in that assumption, please let me know.

Additionally, a question for the group. I opted to include the generated sri-directives.json file, but still generate it on deployment. I wanted to get some feedback on this. I sort of think it should be one or the other. Either (a) generate on deployment (adding it to the .gitignore file) or (b) required it to be manually generated and checked in. Thoughts?

Thanks and cheers!
J

(cc @jdorfman)

@jquerybot
Copy link

Thank you for your pull request. It looks like this may be your first contribution to a jQuery Foundation project, if so we need you to sign our Contributor License Agreement (CLA).

📝 Please visit http://contribute.jquery.org/CLA/ to sign.

After you signed, the PR is checked again automatically after a minute. If there's still an issue, please reply here to let us know.


If you've already signed our CLA, it's possible your git author information doesn't match your CLA signature (both your name and email have to match), for more information, check the status of your CLA check.

@jmervine
Copy link
Contributor Author

jmervine commented Feb 1, 2016

Point of note. I signed the CLA (twice) and verified that both the name and email address that I used match what's in my github.com settings.

Handlebars.registerHelper( "release", function( prefix, release ) {
var html = prefix + " " + release.version + " - " +
"<a href='/" + release.filename + "'>uncompressed</a>";
var sri = function(filename) {
Copy link
Member

Choose a reason for hiding this comment

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

This function should be defined outside of the helper so that it's only ever defined once.

@scottgonzalez
Copy link
Member

There are a lot of code style violations with spacing, but we can fix that when merging.

@scottgonzalez
Copy link
Member

it looks like the rest will need to be implemented in github.com/jquery/jquery-wp-content inside themes/codeorigin.jquery.com. If I am incorrect in that assumption, please let me know.

That's correct. If you have any other questions about the way the sites work or if you run into any issues getting everything set up, just let us know.

Additionally, a question for the group. I opted to include the generated sri-directives.json file, but still generate it on deployment.

Just add it to .gitignore. Alternatively, place the generated file in dist/resources/ and it will not only be ignored, but will be published to the site for others to use if they so desire (it would be available at https://code.jquery.com/resources/sri-directives.json).

@scottgonzalez
Copy link
Member

Point of note. I signed the CLA (twice) and verified that both the name and email address that I used match what's in my github.com settings.

Indeed. However, the CLA check doesn't look at GitHub, it looks at the actual commits in git. In git, you have your name set as Josh, not Joshua. You can either update your git config and reset the author info on these commits, or sign the CLA as Josh.

On a related note, I see that the CLA status page is 404ing. I'll try to take a look at that tomorrow.

@jmervine
Copy link
Contributor Author

jmervine commented Feb 1, 2016

@scottgonzalez Thanks for the feedback. I'll address everything mentioned. If there's a published style guide, or linter that you use, I'd be happy to address any violations.

Cheers and thanks again!
J

grunt.file.mkdir( "dist/resources" );
});

grunt.registerTask( "sri-generate", [ "ensure-dist-resources", "sri:generate" ] );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note, I registered this as such because sri:generate will fail without this step.

@scottgonzalez
Copy link
Member

If there's a published style guide, or linter that you use, I'd be happy to address any violations.

http://contribute.jquery.org/style-guide/js/

We generally lint code with JSHint and JSCS, but we don't currently run those on our site repos.

@jmervine
Copy link
Contributor Author

jmervine commented Feb 1, 2016

Cool. I'll review the style guide tonight and do my best to fix what's missing. I think I got all the spacing specific issues though.

scottgonzalez pushed a commit to jquery/jquery-wp-content that referenced this pull request Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants