Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into release-9.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
roblarsen committed Sep 6, 2023
2 parents 022ca60 + 17073f5 commit 571f79a
Show file tree
Hide file tree
Showing 20 changed files with 88 additions and 492 deletions.
1 change: 0 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ restrictions:

* Please **do not** open issues or pull requests regarding the code in
[`.htaccess`](https://github.com/h5bp/server-configs-apache),
[`Modernizr`](https://github.com/Modernizr/Modernizr) or
[`Normalize.css`](https://github.com/necolas/normalize.css) (open them in
their respective repositories).

Expand Down
1 change: 0 additions & 1 deletion .github/SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ For personal support requests with HTML5 Boilerplate please use Stack Overflow

Please check the respective repository/website for support regarding the code in
[`.htaccess`](https://github.com/h5bp/server-configs-apache),
[`Modernizr`](https://modernizr.com/) or
[`Normalize.css`](https://github.com/necolas/normalize.css).
41 changes: 0 additions & 41 deletions .github/workflows/build-dist.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: streetsidesoftware/cspell-action@v2
- uses: streetsidesoftware/cspell-action@v3
with:
inline: warning
strict: false
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ way that you want.

* [Homepage](https://html5boilerplate.com/)
* [Source Code](https://github.com/h5bp/html5-boilerplate)
* [Twitter(@h5pb)](https://twitter.com/h5bp)

## About This Repository

Expand Down Expand Up @@ -85,8 +84,6 @@ Choose one of the following options:
research and experimentation by over 200 contributors.
* Designed with progressive enhancement in mind.
* Includes:
* A custom build of [`Modernizr`](https://modernizr.com/) for feature
detection.
* Placeholder Open Graph elements and attributes.
* An example package.json file with [WebPack](https://webpack.js.org/) commands
built in to jumpstart application development.
Expand Down
1 change: 0 additions & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

<!-- Add your site or application content here -->
<p>Hello world! This is HTML5 Boilerplate.</p>
<script src="js/vendor/modernizr-3.12.0.min.js"></script>
<script src="js/app.js"></script>

</body>
Expand Down
Empty file added dist/js/vendor/.gitkeep
Empty file.
3 changes: 0 additions & 3 deletions dist/js/vendor/modernizr-3.12.0.min.js

This file was deleted.

3 changes: 0 additions & 3 deletions docs/extend.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ plugin](https://developer.mozilla.org/en-US/docs/Web/OpenSearch).

## Miscellaneous

* Use
[polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills).

* Use [Microformats](http://microformats.org/wiki/Main_Page) (via
[microdata](http://microformats.org/wiki/microdata)) for optimum search
results
Expand Down
64 changes: 0 additions & 64 deletions docs/html.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,68 +136,4 @@ The central part of the boilerplate template is pretty much empty. This is
intentional, in order to make the boilerplate suitable for both web page and web
app development.

### Modernizr

HTML5 Boilerplate uses a custom build of Modernizr.

[Modernizr](https://modernizr.com/) is a JavaScript library which adds classes
to the `html` element based on the results of feature test and which ensures
that all browsers can make use of HTML5 elements (as it includes the HTML5
Shiv). This allows you to target parts of your CSS and JavaScript based on the
features supported by a browser.

Starting with version 3 Modernizr can be customized using the
[modernizr-config.json](https://github.com/h5bp/html5-boilerplate/blob/main/modernizr-config.json)
and the
[Modernizr command line utility](https://www.npmjs.com/package/modernizr-cli).

### What About Polyfills?

If you need to include
[polyfills](https://remysharp.com/2010/10/08/what-is-a-polyfill) in your
project, you must make sure those load before any other JavaScript. If you're
using a polyfill CDN service, like [polyfill.io](https://polyfill.io/v3/), just put
it before the other scripts in the bottom of the page:

```html
<script src="js/vendor/modernizr-3.11.7.min.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js"></script>
<script src="js/app.js"></script>
</body>
```

When you have a bunch of polyfills to load in, you could also
create a `polyfills.js` file in the `js/vendor` directory or include the files
individually and combine them using a build tool. Always ensure that the
polyfills are all loaded before any other JavaScript.

There are some misconceptions about Modernizr and polyfills. It's important to
understand that Modernizr just handles feature checking, not polyfilling itself.
The only thing Modernizr does regarding polyfills is that the team maintains
[a huge list of cross Browser polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills).

### jQuery

As of v8.0.0 we no longer include jQuery by default. Web development has
changed a lot since we started this project and while many millions of sites
still use jQuery there are many sites and applications that don't. 10 years ago
jQuery _was_ JavaScript for most developers. That's not the case any more so
we've made the decision to remove jQuery from the project.

If you're interested in including it, you can easily install jQuery using the
following command:

```
npm install jquery
```

You can then copy the minified file into the `vendor` folder and add jQuery
to the `index.html` manually.

To load jQuery from a CDN with a local fallback you can use the following:

```html
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.6.0.min.js"><\/script>')</script>
```

5 changes: 0 additions & 5 deletions docs/js.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,3 @@ That's cool.
## vendor

This directory can be used to contain all third-party library code.

Our custom build of the Modernizr library is included by
default. You may wish to create your own [custom Modernizr build with the online
builder](https://modernizr.com/download/) or [command line
tool](https://modernizr.com/docs#command-line-config).
6 changes: 2 additions & 4 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ A basic HTML5 Boilerplate site initially looks something like this:
├── img
├── js
│ ├── app.js
│ └── vendor
│ └── modernizr.min.js
└── vendor
├── .editorconfig
├── 404.html
├── favicon.ico
Expand Down Expand Up @@ -165,5 +164,4 @@ It copies the following files and folders to the dist folder:
* tile-wide.png

`js/vendor` is copied over in order to allow you to use unprocessed JS files
(like Modernizr) in addition to the files bundled based on the project's entry
point `app.js.`
in addition to the files bundled based on the project's entry point `app.js.`
18 changes: 1 addition & 17 deletions gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import gulpReplace from 'gulp-replace';
import archiver from 'archiver';
import { globSync } from 'glob'
import { deleteSync } from 'del';
import modernizr from 'modernizr';
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const pkg = require('./package.json');
const modernizrConfig = require('./modernizr-config.json');

const dirs = pkg['h5bp-configs'].directories;

Expand Down Expand Up @@ -74,10 +72,7 @@ gulp.task('clean', (done) => {

gulp.task('copy:index.html', () => {

let modernizrVersion = pkg.devDependencies.modernizr;

return gulp.src(`${dirs.src}/index.html`)
.pipe(gulpReplace(/{{MODERNIZR_VERSION}}/g, modernizrVersion))
.pipe(gulp.dest(dirs.dist));
});

Expand Down Expand Up @@ -115,16 +110,6 @@ gulp.task('copy:misc', () =>
}).pipe(gulp.dest(dirs.dist))
);

gulp.task('modernizr', (done) => {
// TODO: rework this flow instead of just reacting to the fact that the jQuery step is gone
if (!fs.existsSync(`${dirs.dist}/js/vendor/`)){
fs.mkdirSync(`${dirs.dist}/js/vendor/`);
}

modernizr.build(modernizrConfig, (code) => {
fs.writeFile(`${dirs.dist}/js/vendor/modernizr-${pkg.devDependencies.modernizr}.min.js`, code, done);
});
});

gulp.task('lint:js', () =>
gulp.src([
Expand Down Expand Up @@ -152,8 +137,7 @@ gulp.task(
'build',
gulp.series(
gulp.parallel('clean', 'lint:js'),
'copy',
'modernizr'
'copy'
)
);

Expand Down
17 changes: 0 additions & 17 deletions modernizr-config.json

This file was deleted.

Loading

0 comments on commit 571f79a

Please sign in to comment.