Skip to content

Commit

Permalink
Bump to v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
samiahmedsiddiqui committed Jan 18, 2022
1 parent d3d7a73 commit b4dcf48
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 60 deletions.
11 changes: 5 additions & 6 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
*.js text eol=lf

# Remove files using `git archive`.
.* export-ignore
appveyor.yml export-ignore
src export-ignore
test/* export-ignore
!test/runkitExample.js export-ignore
tsconfig.json export-ignore
.* export-ignore
appveyor.yml export-ignore
src export-ignore
test export-ignore
tsconfig.json export-ignore
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ branches:
dist: xenial
language: node_js
node_js:
- 8
- 10
- 12
- 14
- 16
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# native-lazy-loading

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Dependency Status][dependency-image]][dependency-url]
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Open Issues][issues-image]][issues-url] [![License][license-image]][license-url]

Add the `loading` attribute to completely defer the loading of offscreen images and iframes that can be reached by scrolling:

Expand Down Expand Up @@ -442,13 +442,16 @@ This package is tested with the `Node.js` and `React` Application.

[npm-image]: https://img.shields.io/npm/v/native-lazy-loading.svg
[npm-url]: https://www.npmjs.com/package/native-lazy-loading
[downloads-image]: https://img.shields.io/npm/dm/native-lazy-loading.svg
[downloads-image]: https://img.shields.io/npm/dt/native-lazy-loading.svg

[travis-image]: https://img.shields.io/travis/com/samiahmedsiddiqui/native-lazy-loading.svg?label=travis-ci
[travis-url]: https://travis-ci.com/samiahmedsiddiqui/native-lazy-loading
[travis-image]: https://app.travis-ci.com/samiahmedsiddiqui/native-lazy-loading.svg?branch=main
[travis-url]: https://app.travis-ci.com/github/samiahmedsiddiqui/native-lazy-loading

[appveyor-url]: https://ci.appveyor.com/project/samiahmedsiddiqui/native-lazy-loading
[appveyor-image]: https://img.shields.io/appveyor/ci/samiahmedsiddiqui/native-lazy-loading.svg?label=appveyor

[dependency-image]: https://img.shields.io/david/samiahmedsiddiqui/native-lazy-loading.svg
[dependency-url]: https://david-dm.org/samiahmedsiddiqui/native-lazy-loading
[issues-image]: https://img.shields.io/github/issues/samiahmedsiddiqui/native-lazy-loading
[issues-url]: https://github.com/samiahmedsiddiqui/native-lazy-loading/issues

[license-image]: https://img.shields.io/github/license/samiahmedsiddiqui/native-lazy-loading
[license-url]: https://github.com/samiahmedsiddiqui/native-lazy-loading/blob/main/LICENSE
4 changes: 1 addition & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ branches:
environment:
matrix:
# node.js
- nodejs_version: "8"
- nodejs_version: "10"
- nodejs_version: "12"
- nodejs_version: "14"
- nodejs_version: "16"
- nodejs_version: ""

install:
- ps: Install-Product node $env:nodejs_version
- npm install --dev
- npm install --also=dev

test_script:
- npm run lint
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "native-lazy-loading",
"version": "1.1.0",
"version": "2.0.0",
"description": "Add the loading attribute to completely defer the loading of offscreen images and iframes.",
"main": "index.js",
"types": "types/index.d.ts",
"files": [
"LICENSE",
"index.js",
"test/runkitExample.js",
"runkitExample.js",
"types/index.d.ts"
],
"scripts": {
Expand Down Expand Up @@ -38,7 +38,7 @@
"url": "https://github.com/samiahmedsiddiqui/native-lazy-loading/issues"
},
"homepage": "https://github.com/samiahmedsiddiqui/native-lazy-loading#readme",
"runkitExampleFilename": "test/runkitExample.js",
"runkitExampleFilename": "runkitExample.js",
"dependencies": {
"posthtml-parser": "0.10.2",
"posthtml-render": "3.0.0"
Expand Down
37 changes: 37 additions & 0 deletions runkitExample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const nativeLazyLoading = require('native-lazy-loading');
const html = `<img src="https://www.yasglobal.com/wp-content/themes/yasglobal/images-cus/logo.svg" alt="YAS Global Logo" title="YAS Global Logo" class="no-lazy"/>
<div class="white logos">
<div class="container">
<div class="testimonials">
<div class="item">
<img src="/wordpress-logo.svg" style="margin-top: -9px;" alt="WordPress Logo" title="WordPress Logo" class="testing-lazyload" />
</div>
<div class="item">
<img src="/drupal-logo.svg" style="margin-top: -9px;" alt="Drupal Logo" title="Drupal Logo" class="testing-lazyload" />
</div>
<div class="item">
<img src="/contentful-logo.svg" style="margin-top: -9px;" alt="Contentful Logo" title="Contentful Logo" class="testing-lazyload" />
</div>
<div class="item">
<img src="/contentstack-logo.svg" style="margin-top: -9px;" alt="ContentStack Logo" title="ContentStack Logo" />
</div>
<div class="item">
<img src="/netlify-logo.svg" style="margin-top: -9px;" alt="Netlify Logo" title="Netlify Logo" class="testing-lazyload" />
</div>
<div class="item">
<img src="/heroku-logo.svg" style="margin-top: -9px;" alt="Heroku Logo" title="Heroku Logo" class="testing-lazyload" />
</div>
<div class="item">
<img src="/pantheon-logo.svg" style="margin-top: -9px;" alt="Pantheon Logo" title="Pantheon Logo" />
</div>
<div class="item">
<img src="/wpengine-logo.svg" style="margin-top: -9px;" alt="WPs Engine Logo" title="WP Engine Logo" class="testing-lazyload" />
</div>
</div>
<iframe src="https://www.w3schools.com" name="w3schools" class="testing-lazyload"></iframe>
</div>
</div>`;

console.log('Before applying Native Lazy Loading: ', html);
console.log('After applying Native Lazy Loading: ', nativeLazyLoading(html));
37 changes: 0 additions & 37 deletions test/runkitExample.js

This file was deleted.

0 comments on commit b4dcf48

Please sign in to comment.