-
Notifications
You must be signed in to change notification settings - Fork 0
Upgrading Modernizr in the Framework
When a new version of Modernizr is available, the update will not automatically be pulled into the framework. This should be a deliberate action with proper testing. Modernizr is controlled with Grunt. Here are the steps to update Modernizr in the framework:
npm update grunt-modernizr
What this does: Checks if the grunt-modernizr
package has an available
update and installs it.
grunt upgrade_modernizr
What this does:
- Generates a new Modernizr build based on the defined tests array in the
modernizr
function in the framework'sGruntfile.js
file. - Copies this file to the
js/vendor
folder. - Runs
uglify
to generate a minimized version of the new build. - Changes the
RESPONSIVE_MODERNIZR_VERSION
constant to reflect the value of the new Modernizr build.
These are the files that will potentially be changed and need to be committed to the repository:
-
package.json
(if thegrunt-modernizr
package has an update). -
package-lock.json
(if thegrunt-modernizr
package has an update). -
functions.php
(the updated Modernizr constant value). js/vendor/modernizr.js
js/vendor/modernizr.min.js
A new Modernizr build may need to be generated even if Modernizr itself does
not have a new version. For example, a new test may need to be added to the
framework's build. When this is the case, you will need to manually change the
RESPONSIVE_MODERNIZR_VERSION
version after completing step 2.
When this situation comes up, the GitHub task number should be added to the end of the Modernizr version.
Example: Modernizr version 3.6.0 is in the theme. There is no update to
Modernizr. The cryptography
check needs to be added to the framework's build.
The RESPONSIVE_MODERNIZR_VERSION
constant's value should be changed to
3.6.0-###
where ###
is the GitHub issue number describing the changes being
made to the framework's build.
Ensuring the version number is different is needed to ensure that all users receive the new build when it is deployed. This is known as a method of cache busting.
Get started
Configuration
Build child themes
- Customizing CSS in a child theme
- Overriding templates in a child theme
- Code patterns
- Code reviews
- Pulling in Foundation Updates
- Merging and Creating a Pull Request
Sass
Javascript
PHP
- Coding Standards
- PHP Constants
- Temp PHP Code Patterns
- PHP Snippets
- How to Use Hooks
- Action Hooks
- Using Action Hooks To Output Markup
- Filter Hooks
Shortcodes
Templates
GitHub
Tasks
Contribute to the framework
- Framework Development and Release Workflows
- Documentation Template
- Testing your changes
- Creating a new release
- Migration Guide
- Needs Documentation
Code Examples
- Adding Content Container Classes
- Adding News Templates
- Adding Script Dependencies
- Changing Available Layouts and Default Layout
- Displaying a Fancy Gallery
- Loading a Custom Build of Modernizr
- Loading Modernizr in the Footer
- Using Action Hooks To Output Markup
- Understanding get_template_part
BU Developer Resources