From 3a444ca4471daee38c692501df932f6fc834f4a0 Mon Sep 17 00:00:00 2001 From: Rob Larsen Date: Thu, 24 Sep 2020 19:17:14 -0400 Subject: [PATCH 1/4] Renames main.js to app.js closes #2340 --- CHANGELOG.md | 4 ++++ dist/doc/html.md | 2 +- dist/doc/js.md | 2 +- dist/doc/usage.md | 2 +- dist/index.html | 2 +- src/doc/html.md | 2 +- src/doc/js.md | 2 +- src/doc/usage.md | 2 +- src/index.html | 2 +- src/js/{main.js => app.js} | 0 test/file_existence.js | 2 +- 11 files changed, 13 insertions(+), 9 deletions(-) rename src/js/{main.js => app.js} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index f59341dd9f..3f568ab517 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 9.0.0 (TBD) + +* Rename CSS file and JS file + ## 8.0.0 (June 04, 2020) * Add a sample package.json with basic Parcel commands ([#2227](https://github.com/h5bp/html5-boilerplate/pull/2229)), ([231e047](https://github.com/h5bp/html5-boilerplate/commit/231e047d270316b454156dc261e6e04da660e2a2)) diff --git a/dist/doc/html.md b/dist/doc/html.md index 1d37456b8c..a29fddf00c 100644 --- a/dist/doc/html.md +++ b/dist/doc/html.md @@ -168,7 +168,7 @@ it before the other scripts in the bottom of the page: - + ``` diff --git a/dist/doc/js.md b/dist/doc/js.md index 4d3e5537dd..542c253a2f 100644 --- a/dist/doc/js.md +++ b/dist/doc/js.md @@ -5,7 +5,7 @@ table of contents](TOC.md) Information about the default JavaScript included in the project. -## main.js +## app.js This file can be used to contain or reference your site/app JavaScript code. If you're working on something more advanced you might replace this file entirely. diff --git a/dist/doc/usage.md b/dist/doc/usage.md index 1469a935b1..8dfc6f760a 100644 --- a/dist/doc/usage.md +++ b/dist/doc/usage.md @@ -35,7 +35,7 @@ A basic HTML5 Boilerplate site initially looks something like this: ├── doc ├── img ├── js -│ ├── main.js +│ ├── app.js │ ├── plugins.js │ └── vendor │ └── modernizr.min.js diff --git a/dist/index.html b/dist/index.html index acb058c522..1fb8ef3f57 100644 --- a/dist/index.html +++ b/dist/index.html @@ -28,7 +28,7 @@

Hello world! This is HTML5 Boilerplate.

- + - + ``` diff --git a/src/doc/js.md b/src/doc/js.md index 4d3e5537dd..542c253a2f 100644 --- a/src/doc/js.md +++ b/src/doc/js.md @@ -5,7 +5,7 @@ table of contents](TOC.md) Information about the default JavaScript included in the project. -## main.js +## app.js This file can be used to contain or reference your site/app JavaScript code. If you're working on something more advanced you might replace this file entirely. diff --git a/src/doc/usage.md b/src/doc/usage.md index 1469a935b1..8dfc6f760a 100644 --- a/src/doc/usage.md +++ b/src/doc/usage.md @@ -35,7 +35,7 @@ A basic HTML5 Boilerplate site initially looks something like this: ├── doc ├── img ├── js -│ ├── main.js +│ ├── app.js │ ├── plugins.js │ └── vendor │ └── modernizr.min.js diff --git a/src/index.html b/src/index.html index aca356ba94..9d593fad79 100644 --- a/src/index.html +++ b/src/index.html @@ -28,7 +28,7 @@

Hello world! This is HTML5 Boilerplate.

- + - ``` -If you like to just include the polyfills yourself, you could include them in -`js/plugins.js`. When you have a bunch of polyfills to load in, you could also +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. diff --git a/dist/doc/js.md b/dist/doc/js.md index 542c253a2f..58513cffb3 100644 --- a/dist/doc/js.md +++ b/dist/doc/js.md @@ -11,20 +11,6 @@ This file can be used to contain or reference your site/app JavaScript code. If you're working on something more advanced you might replace this file entirely. That's cool. -## plugins.js - -This file can be used to contain all your plugins, such as jQuery plugins and -other 3rd party scripts for a simple site. - -One approach is to put jQuery plugins inside of a `(function($){ ...})(jQuery);` -closure to make sure they're in the jQuery namespace safety blanket. Read more -about [jQuery plugin authoring](https://learn.jquery.com/plugins/). - -By default the `plugins.js` file contains a small script to avoid `console` -errors in browsers that lack a `console`. The script will make sure that, if a -console method isn't available, that method will have the value of empty -function, thus, preventing the browser from throwing an error. - ## vendor This directory can be used to contain all 3rd party library code. diff --git a/dist/doc/usage.md b/dist/doc/usage.md index ef85525d94..920646444e 100644 --- a/dist/doc/usage.md +++ b/dist/doc/usage.md @@ -36,7 +36,6 @@ A basic HTML5 Boilerplate site initially looks something like this: ├── img ├── js │ ├── app.js -│ ├── plugins.js │ └── vendor │ └── modernizr.min.js ├── .editorconfig diff --git a/dist/index.html b/dist/index.html index a6e1472a7f..b18a6a4024 100644 --- a/dist/index.html +++ b/dist/index.html @@ -27,7 +27,6 @@

Hello world! This is HTML5 Boilerplate.

- diff --git a/dist/js/plugins.js b/dist/js/plugins.js deleted file mode 100644 index feb7d19e6e..0000000000 --- a/dist/js/plugins.js +++ /dev/null @@ -1,24 +0,0 @@ -// Avoid `console` errors in browsers that lack a console. -(function() { - var method; - var noop = function () {}; - var methods = [ - 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', - 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', - 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', - 'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn' - ]; - var length = methods.length; - var console = (window.console = window.console || {}); - - while (length--) { - method = methods[length]; - - // Only stub undefined methods. - if (!console[method]) { - console[method] = noop; - } - } -}()); - -// Place any jQuery/helper plugins in here. diff --git a/src/doc/extend.md b/src/doc/extend.md index 4dc0040f39..35379d7e66 100644 --- a/src/doc/extend.md +++ b/src/doc/extend.md @@ -118,25 +118,6 @@ and [Event](https://developers.google.com/analytics/devguides/collection/analyticsjs/events) Docs. -### Track jQuery AJAX requests in Google Analytics - -An article by @JangoSteve explains how to [track jQuery AJAX requests in Google -Analytics](https://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/). - -Add this to `plugins.js`: - -```js -/* - * Log all jQuery AJAX requests to Google Analytics - * See: https://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/ - */ -if (typeof ga !== "undefined" && ga !== null) { - $(document).ajaxSend(function(event, xhr, settings){ - ga('send', 'pageview', settings.url); - }); -} -``` - ### Track JavaScript errors in Google Analytics Add this function after `ga` is defined: diff --git a/src/doc/html.md b/src/doc/html.md index a29fddf00c..f61c7935eb 100644 --- a/src/doc/html.md +++ b/src/doc/html.md @@ -167,13 +167,11 @@ it before the other scripts in the bottom of the page: ```html - ``` -If you like to just include the polyfills yourself, you could include them in -`js/plugins.js`. When you have a bunch of polyfills to load in, you could also +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. diff --git a/src/doc/js.md b/src/doc/js.md index 542c253a2f..58513cffb3 100644 --- a/src/doc/js.md +++ b/src/doc/js.md @@ -11,20 +11,6 @@ This file can be used to contain or reference your site/app JavaScript code. If you're working on something more advanced you might replace this file entirely. That's cool. -## plugins.js - -This file can be used to contain all your plugins, such as jQuery plugins and -other 3rd party scripts for a simple site. - -One approach is to put jQuery plugins inside of a `(function($){ ...})(jQuery);` -closure to make sure they're in the jQuery namespace safety blanket. Read more -about [jQuery plugin authoring](https://learn.jquery.com/plugins/). - -By default the `plugins.js` file contains a small script to avoid `console` -errors in browsers that lack a `console`. The script will make sure that, if a -console method isn't available, that method will have the value of empty -function, thus, preventing the browser from throwing an error. - ## vendor This directory can be used to contain all 3rd party library code. diff --git a/src/doc/usage.md b/src/doc/usage.md index ef85525d94..920646444e 100644 --- a/src/doc/usage.md +++ b/src/doc/usage.md @@ -36,7 +36,6 @@ A basic HTML5 Boilerplate site initially looks something like this: ├── img ├── js │ ├── app.js -│ ├── plugins.js │ └── vendor │ └── modernizr.min.js ├── .editorconfig diff --git a/src/index.html b/src/index.html index 22b12135b0..15cf4d7eb8 100644 --- a/src/index.html +++ b/src/index.html @@ -27,7 +27,6 @@

Hello world! This is HTML5 Boilerplate.

- diff --git a/src/js/plugins.js b/src/js/plugins.js deleted file mode 100644 index feb7d19e6e..0000000000 --- a/src/js/plugins.js +++ /dev/null @@ -1,24 +0,0 @@ -// Avoid `console` errors in browsers that lack a console. -(function() { - var method; - var noop = function () {}; - var methods = [ - 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', - 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', - 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', - 'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn' - ]; - var length = methods.length; - var console = (window.console = window.console || {}); - - while (length--) { - method = methods[length]; - - // Only stub undefined methods. - if (!console[method]) { - console[method] = noop; - } - } -}()); - -// Place any jQuery/helper plugins in here. diff --git a/test/file_existence.js b/test/file_existence.js index 74acfb0ab4..bd4ff1e897 100644 --- a/test/file_existence.js +++ b/test/file_existence.js @@ -48,7 +48,6 @@ const expectedFilesInDistDir = [ 'js/', 'js/app.js', - 'js/plugins.js', 'js/vendor/', `js/vendor/modernizr-${pkg.devDependencies.modernizr}.min.js`, From ed3fee5b885a43dcd30eda61ea35ab268803f040 Mon Sep 17 00:00:00 2001 From: Rob Larsen Date: Tue, 29 Sep 2020 08:47:06 -0400 Subject: [PATCH 4/4] Removes some stray references to jQuery --- .github/CONTRIBUTING.md | 1 - .github/ISSUE_TEMPLATE.md | 1 - .github/SUPPORT.md | 1 - dist/humans.txt | 2 +- src/humans.txt | 2 +- 5 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 5bff0caa22..5e774cb91f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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), - [`jQuery`](https://github.com/jquery/jquery/), [`Modernizr`](https://github.com/Modernizr/Modernizr) or [`Normalize.css`](https://github.com/necolas/normalize.css) (open them in their respective repositories). diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 2f02c0a7e4..e36360dfd4 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -14,7 +14,6 @@ * Please **do not** open issues or pull requests regarding the code in [`.htaccess`](https://github.com/h5bp/server-configs-apache), - [`jQuery`](https://github.com/jquery/jquery/), [`Modernizr`](https://github.com/Modernizr/Modernizr) or [`Normalize.css`](https://github.com/necolas/normalize.css) (open them in their respective repositories). diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md index f205c19ea1..6bbe6d8a1a 100644 --- a/.github/SUPPORT.md +++ b/.github/SUPPORT.md @@ -5,6 +5,5 @@ 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), - [`jQuery`](https://jquery.org/support/), [`Modernizr`](https://modernizr.com/) or [`Normalize.css`](https://github.com/necolas/normalize.css). diff --git a/dist/humans.txt b/dist/humans.txt index 8d2330fdb2..d4c1c683e1 100644 --- a/dist/humans.txt +++ b/dist/humans.txt @@ -12,4 +12,4 @@ # TECHNOLOGY COLOPHON CSS3, HTML5 - Apache Server Configs, jQuery, Modernizr, Normalize.css + Apache Server Configs, Modernizr, Normalize.css, main.css, Parcel diff --git a/src/humans.txt b/src/humans.txt index 8d2330fdb2..d4c1c683e1 100644 --- a/src/humans.txt +++ b/src/humans.txt @@ -12,4 +12,4 @@ # TECHNOLOGY COLOPHON CSS3, HTML5 - Apache Server Configs, jQuery, Modernizr, Normalize.css + Apache Server Configs, Modernizr, Normalize.css, main.css, Parcel