Comments (3)
Some thoughts:
For JS, we can have an additional script tag that lets us know when the previous script has finished since script tags are blocking. We might need one beforehand as well to make sure we catch any potential errors thrown by the script though.
For CSS, we can poll the sheet
/styleSheet
property to check how many rules are defined. Alternatively, we can use the <img>
onerror hack, but this loses the ability to between loads and errors.
In general, JS onload/onerror support is solid while CSS onload/onerror support is kind of spotty:
- https://pie.gd/test/script-link-events/
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Browser_compatibility
from ember-asset-loader.
Turns out onload
/onerror
is supported for script
tags in all the browsers we need to support.
However, img
tags are super spotty. There is no way to feature detect support either. So we're going to set onload
/onerror
and use them if they fire, otherwise we'll just poll the document.styleSheets
property to determine when it loads and resolve
then. Unfortunately, that means for IE/old Phantom we won't be able to distinguish between successful and failed loads.
from ember-asset-loader.
Closed via #7.
from ember-asset-loader.
Related Issues (20)
- CI/tests failing HOT 2
- storeConfigInMeta
- Need file order in configuration. HOT 6
- assetLoader Service is required in host route and component unit tests HOT 3
- Weird fingerprinting of images HOT 1
- How use contentFor in engines HOT 2
- manifest-inserter causes index.html to show up as changed on every rebuild HOT 21
- Should not include empty files in generated asset manifest. HOT 3
- Add template helper for loading a bundle. HOT 21
- Support for loading non-engines assets lazily when needed. HOT 1
- Improve CI to avoid dependency drift HOT 2
- On Windows, engine asset paths use back slashes instead of forward slashes HOT 7
- CSS asset loader, `onload` event called too soon. (can only repro on firefox) HOT 3
- Need an option to add Subresource Integrity(SRI) in engine assets HOT 1
- The loader when in node land does nothing, can we teach it to put link/script tags in the DOM?
- option to make resetting asset state in tests less noisy HOT 3
- Multiple meta tags inserted into head-footer when multiple addons use ManifestGenerator HOT 1
- Repeatedly performing npm-install fails with EISGIT: Appears to be a git repo or submodule HOT 3
- No manifest generated for engine when external addon extends from ember-asset-loader HOT 4
- API request: the ability to retrieve the list of assets loaded/in the cache HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-asset-loader.