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

build: bundling #96

Merged
merged 38 commits into from
Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
652fdd2
feat(modules): introduced other js module formats
Feb 7, 2021
402d12b
refactor: updated dependencies
Feb 7, 2021
26b2aa4
chore: code optimization
Feb 7, 2021
51e887d
chore: added use strict again
Feb 7, 2021
8009384
chore(structure): moved that file back to the root
Feb 14, 2021
c9e3158
refactor: providing a better sounding and differentiable method
Feb 15, 2021
88b233b
fix: missed to export the correct variable the latest
Feb 15, 2021
ccb4b86
docs(api): mentioning the public method
Feb 15, 2021
450d4b2
refactor(browserlist): dropping IE8
Feb 16, 2021
11bf73e
Merge branch 'master' into build-bundling
Feb 16, 2021
8da8b8c
refactor: regenerated the JS files
Feb 16, 2021
89da81a
chore: removed previous build tools config
Feb 16, 2021
73fd419
test(xo): integrated some valid feedback
Feb 16, 2021
4d7827c
test(xo): integrated some valid feedback
Feb 16, 2021
b122a6a
Merge branch 'master' into build-bundling
Feb 16, 2021
9ed5ada
Merge branch 'master' into build-bundling
Feb 20, 2021
7c7e5cb
chore: regenerated package-lock.json file
Feb 20, 2021
d80916d
Merge branch 'master' into build-bundling
Feb 21, 2021
d1a87e6
chore: regenerated package-lock.json
Feb 21, 2021
1a91140
refactor: changed this to the new husky format
Feb 26, 2021
8058111
Merge branch 'master' into build-bundling
Feb 27, 2021
a34ed4b
chore: regenerated the package-lock file
Feb 27, 2021
1665328
Merge branch 'master' into build-bundling
Feb 27, 2021
43881cf
Merge branch 'master' into build-bundling
Feb 27, 2021
81a97ef
refactor(prettier): added relevant configuration
Feb 27, 2021
fdcfad5
refactor: regenerated the dist files
Feb 27, 2021
70c77c2
Merge branch 'master' into build-bundling
Feb 27, 2021
cd39a75
Merge branch 'master' into build-bundling
Feb 27, 2021
1eaf2a5
Merge branch 'master' into build-bundling
Feb 27, 2021
b7587a9
Merge branch 'master' into build-bundling
Feb 28, 2021
3eccc02
Merge branch 'master' into build-bundling
Feb 28, 2021
df1fb9d
Merge branch 'master' into build-bundling
Feb 28, 2021
54b1c79
Merge branch 'master' into build-bundling
Feb 28, 2021
6eaf56a
chore: regenerated package-lock.json
Feb 28, 2021
f80a508
Merge branch 'master' into build-bundling
Mar 1, 2021
eb9cc86
Merge branch 'master' into build-bundling
mfranzke Mar 4, 2021
e0bde0c
build: rebuild the distributed files
mfranzke Mar 4, 2021
9340e88
build: prepared the next beta release
mfranzke Mar 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
> 0.1%, IE >= 9
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node_modules
config.codekit3
3 changes: 1 addition & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
demo
webdriverio-tests
.gitignore
.huskyrc
config.codekit3
.husky
commitlint.config.js
wdio.conf-crossbrowsertesting.js
.github
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*.min.js
dist
package-lock.json
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"trailingComma": "es5"
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
And the commit messages from [Conventional Commits](https://conventionalcommits.org) are being used.

## [2.0.0-beta.1] - 2021-03-04

### Changed

- BREAKING CHANGE: Even also generate JS modules from now on supported by [microbundle](https://npmjs.com/microbundle), added the relevant property entries within the `package.json` directing to those files, that are now stored within the `dist/` folder (see [migration guide](MIGRATION.md) [#19](https://github.com/mfranzke/loading-attribute-polyfill/issues/19), [#87](https://github.com/mfranzke/loading-attribute-polyfill/pull/87), [#39](https://github.com/mfranzke/loading-attribute-polyfill/pull/39))

## [2.0.0-beta.0] - 2021-03-04

### Fixed
Expand Down
6 changes: 5 additions & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Migration guidelines

## 2.0.0 migration guide
## 2.0.0-beta.1 migration guide

We've switched from previously only providing the source and a minified version of the JS, to additionally provide the different relevant JavaScript formats especially regarding modules supported by [microbundle](https://npmjs.com/microbundle). Thatfor we even also changed the location of the generated files as well as pointed the relevant property entries within the `package.json` to those files. Please find all the relevant generated files in the `dist/` folder from now on.

## 2.0.0-beta.0 migration guide

You'll need to wrap the `<picture>` tag instead of the included HTML tags with `<noscript>`.

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ And the images are still displaying an error in the demo on IE9, as most likely

## API

Nothing really, just integrate it as shown within the "installation" section, and it ~~will~~ should work out of the box.
In case that you're dynamically adding HTML elements within the browser, you could call the following method with an included [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) object, like e.g.:

```JavaScript
loadingAttributePolyfill.prepareElement(document.querySelector('main noscript.loading-lazy'));
```

## Demo

Expand Down
1 change: 0 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"webdriverio-tests",
".gitignore",
".huskyrc",
"config.codekit3",
"commitlint.config.js",
"wdio.conf-crossbrowsertesting.js"
]
Expand Down
4 changes: 3 additions & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,12 @@
integrity="sha384-0lS88tVtaG/wFBGhLbltQH+YsokYzFR53GbESKurNNjMEVpukFjECmLmebK9aMIf"
crossorigin="anonymous"
></script>
<script type="module" src="index.js"></script>
<!-- Even though that it's recommended to omit the type on the following script tag, we're keeping it for older browser compatibility -->
<script
type="text/javascript"
src="../loading-attribute-polyfill.min.js"
src="../dist/loading-attribute-polyfill.umd.js"
nomodule
></script>
</body>
</html>
21 changes: 21 additions & 0 deletions demo/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import loadingAttributePolyfill from '../dist/loading-attribute-polyfill.module.js';

// Test for dynamically inserted images
window.setTimeout(() => {
let child = document.createElement('div');
child.innerHTML = '<noscript class="loading-lazy"></noscript>';
child = child.firstChild;

let imageElement = document.createElement('img');
imageElement.setAttribute('src', 'https://via.placeholder.com/300');
imageElement.setAttribute('loading', 'lazy');
imageElement.setAttribute('alt', '..');
imageElement.setAttribute('width', '250');
imageElement.setAttribute('height', '150');
child.appendChild(imageElement);
document
.getElementsByTagName('main')[0]
.insertBefore(child, document.getElementsByTagName('main')[0].firstChild);

loadingAttributePolyfill.prepareElement(document.querySelector('main noscript.loading-lazy'));
}, 5000);
2 changes: 2 additions & 0 deletions dist/loading-attribute-polyfill.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/loading-attribute-polyfill.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading