Giter Site home page Giter Site logo

dmnsgn / async-preloader Goto Github PK

View Code? Open in Web Editor NEW
58.0 58.0 2.0 10.92 MB

Assets preloader using ES2017 async/await and fetch.

Home Page: https://dmnsgn.github.io/async-preloader/

License: MIT License

JavaScript 92.55% HTML 0.44% TypeScript 7.01%
async async-await es2017 fetch preloader typescript

async-preloader's People

Contributors

brunoimbrizi avatar dependabot[bot] avatar dmnsgn avatar greenkeeper[bot] avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

brunoimbrizi

async-preloader's Issues

Module parse failed: Unexpected token (310:21)

Failed to compile
./node_modules/async-preloader/lib/index.js 310:21
Module parse failed: Unexpected token (310:21)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|      */
|     static getFileExtension(path) {
>         return (path?.match(/[^\\/]\.([^.\\/]+)$/) || [null]).pop();
|     }
|     /**

Hi, I found this error while testing this library.

here's a part of my package.json

"react": "^18.1.0",
"typescript": "^4.1.2",
"@craco/craco": "^6.4.3",
 "@types/react-lottie": "^1.2.6",
"@types/react-sticky": "^6.0.4",
 "craco-esbuild": "^0.5.0"

An in-range update of rollup is breaking the build 🚨

The devDependency rollup was updated from 1.18.0 to 1.19.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 6 commits.

  • 9af119d 1.19.0
  • b3f361c Update changelog
  • 456f4d2 Avoid variable from empty module name be empty (#3026)
  • 17eaa43 Use id of last module in chunk as name base for auto-generated chunks (#3025)
  • 871bfa0 Switch to a code-splitting build and update dependencies (#3020)
  • 2443783 Unified file emission api (#2999)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of rollup is breaking the build 🚨

The devDependency rollup was updated from 1.9.2 to 1.9.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v1.9.3

2019-04-10

Bug Fixes

  • Simplify return expressions that are evaluated before the surrounding function is bound (#2803)

Pull Requests

  • #2803: Handle out-of-order binding of identifiers to improve tree-shaking (@lukastaegert)
Commits

The new version differs by 3 commits.

  • 516a06d 1.9.3
  • a5526ea Update changelog
  • c3d73ff Handle out-of-order binding of identifiers to improve tree-shaking (#2803)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/node is breaking the build 🚨

The devDependency @types/node was updated from 11.11.6 to 11.11.7.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/node is breaking the build 🚨

The devDependency @types/node was updated from 10.12.7 to 10.12.8.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of rollup is breaking the build 🚨

The devDependency rollup was updated from 1.4.1 to 1.4.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v1.4.2

2019-03-07

Bug Fixes

  • Respect variable identity of exports when hashing (#2741)
  • Resolve a situations where a variable was imported twice with the same name (#2737)

Pull Requests

Commits

The new version differs by 6 commits.

  • adaa23e 1.4.2
  • 2d03a67 Update changelog
  • 858fea4 Resolve a situation where different default exports referencing the same (#2737)
  • 6903425 Update changelog
  • af41561 Fix an issue where the same hash was generated when different variables (#2741)
  • d27c0f6 Docs: Fix return type (#2738)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of fontfaceobserver-es is breaking the build 🚨

The dependency fontfaceobserver-es was updated from 3.2.0 to 3.3.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

fontfaceobserver-es is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 12 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/jest is breaking the build 🚨

The devDependency @types/jest was updated from 24.0.9 to 24.0.10.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/jest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of rollup is breaking the build 🚨

The devDependency rollup was updated from 1.14.2 to 1.14.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v1.14.3

2019-06-06

Bug Fixes

  • Generate correct external imports when importing from a directory that would be above the root of the current working directory (#2902)

Pull Requests

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/node is breaking the build 🚨

The devDependency @types/node was updated from 11.10.5 to 11.10.6.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/node is breaking the build 🚨

The devDependency @types/node was updated from 12.6.9 to 12.7.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

ParseError: 'import' and 'export' may appear only with 'sourceType: module'

Building a project with [email protected] yielded the following parse error:

C:\Users\bruno\Documents\jobs\2018\thirty-three\ee-careers\node_modules\lodash-es\get.js:1
import baseGet from './_baseGet.js';
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'

Reverting to the previous version I had installed [email protected] made the error disappear.

Just a quick issue report, I haven't had the time to investigate it any further.

An in-range update of @types/node is breaking the build 🚨

The devDependency @types/node was updated from 11.12.1 to 11.12.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Status "pending" on Safari

Hey @dmnsgn, i tried your async preloader, and i dont know why am i facing this problem on :

Safari Desktop : Version 11.0.3 (13604.5.6) (Sometimes 'pending')'
Safari Mobile : Version iOS 11.4.1 (Always 'pending')'

Here is my code :

import './style.scss';

import './videos/screencastBoucle.mp4'
import './videos/screencastFeatureInterface.mp4'
import './videos/screencastForecast.mp4'
import './videos/screencastNotif.mp4'

import Scroll from './js/scroll'

import AsyncPreloader from "async-preloader";

const items = [
   { "id": "screencastBoucle",  "src": "./video/screencastBoucle.mp4" },
   { "id": "screencastFeatureInterface",  "src": "./video/screencastFeatureInterface.mp4" },
   { "id": "screencastForecast",  "src": "./video/screencastForecast.mp4" },
   { "id": "screencastNotif",  "src": "./video/screencastNotif.mp4" }
 ];

 pItems
   .then(items => {
    // When pending do not enter

     console.log('Items', items)
   })
   .then(() => {
    // When pending do not enter

     let scroll = new Scroll(items, AsyncPreloader)

     animate.animateOnLoad()
   })

Thanks @dmnsgn :) and cool the lib by the way

An in-range update of ts-jest is breaking the build 🚨

The devDependency ts-jest was updated from 24.0.0 to 24.0.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

ts-jest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 23 commits.

  • b43b3c1 chore(release): 24.0.1
  • 2d91a37 chore: update package-lock
  • 485d3f7 build(deps): bump semver from 5.6.0 to 5.7.0 (#1043)
  • 2bd2534 build(deps-dev): bump @types/node from 10.14.3 to 10.14.4 (#1041)
  • bdba560 build(deps-dev): bump @types/node from 10.14.2 to 10.14.3 (#1038)
  • 08766bf build(deps-dev): bump @types/node from 10.14.1 to 10.14.2 (#1036)
  • 5f92fd2 build(deps-dev): bump js-yaml from 3.12.2 to 3.13.0 (#1034)
  • a9c79e9 build(deps-dev): bump @types/yargs from 12.0.9 to 12.0.10 (#1032)
  • 245ab29 build(deps-dev): bump eslint from 5.15.2 to 5.15.3 (#1031)
  • 4e72e59 build(deps-dev): bump eslint from 5.15.1 to 5.15.2 (#1030)
  • fb7dd55 feat(config): specify package.json location (#823) (#1013)
  • 279edcd build(deps-dev): bump tslint from 5.13.1 to 5.14.0 (#1028)
  • 8b93228 build(deps-dev): bump @types/node from 10.12.30 to 10.14.1 (#1027)
  • b825c7f build(deps-dev): bump @types/lodash.memoize from 4.1.4 to 4.1.6 (#1014)
  • 6f0ab80 build(deps-dev): bump @types/lodash.merge from 4.6.5 to 4.6.6 (#1015)

There are 23 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of rollup is breaking the build 🚨

The devDependency rollup was updated from 0.67.3 to 0.67.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Video never loads on iOS 11 Safari

Videos are not loading on iOS 11 Safari and no errors are caught. Consider the following example:

import AsyncPreloader from "async-preloader";

const items = [
  { "id": "myVideoFile",      "src": "assets/video.mp4" }
];

const pItems = AsyncPreloader.loadItems(items);

pItems
  .then(items => {
    const element = AsyncPreloader.items.get("myVideoFile");
    console.log(element); // <-- on iOS 11 Safari this is never reached
  })
  .catch(error => console.error("Error loading items", error));

It might be related to #4.

Video with srcObject never loads on Safari

After Use srcObject for HTMLMediaElement the issues with videos never loading on Safari are back.

Example:

import AsyncPreloader from "async-preloader";

const items = [{ "id": "myVideoFile", "src": "assets/video.mp4" }];
const pItems = AsyncPreloader.loadItems(items);
  • MacOS Mojave Safari 12
  • MacOS High Sierra Safari 11.1
  • iPhone XS iOS 12 Safari
  • iPhone 8 iOS 11 Safari

[Error] Not allowed to load local resource: blob:blobinternal:///f036178f-fd56-4c6a-9cb5-29b27b9b11a4

  • MacOS Sierra Safari 10
  • iPhone 7 iOS 10 Safari

Preloader fails silently. No errors.

--

Placing logs inside the try...catch block in loadVideo shows that in all of the scenarios above the execution never goes inside catch, hence stopping at video.srcObject = data;

By commenting out the try...catch block and leaving only video.src = URL.createObjectURL(data); the results change:

  • MacOS Mojave Safari 12
  • MacOS High Sierra Safari 11.1
  • iPhone XS iOS 12 Safari
  • iPhone 8 iOS 11 Safari

Preloader works. canplaythrough is fired.

  • MacOS Sierra Safari 10
  • iPhone 7 iOS 10 Safari

error is fired here and promise is rejected.

--

Safari's compatibility with srcObject is listed as unknown on MDN.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.