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

Examples and tutorials should reference NPM #44

Open
KnicKnic opened this issue Jun 23, 2019 · 0 comments
Open

Examples and tutorials should reference NPM #44

KnicKnic opened this issue Jun 23, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@KnicKnic
Copy link
Owner

KnicKnic commented Jun 23, 2019

Problem

Current sample code references my private version of hosted imagemagick wasm binaries on my github page.

  1. It is not versioned
  2. Not guaranteed up to date
  3. not guaranteed to not change over time

Solution

Use a CDN that automatically pulls from npm. This gives versioning, guaranteed upto date as well as speed.

Which CDN

Current plan is to use unpkg.com . I chose it because it was shorter a shorter url.

@cancerberoSgx Should we use a different one?

// import * as Magick from 'https://knicknic.github.io/wasm-imagemagick/magickApi.js';
import * as Magick from 'https://unpkg.com/wasm-imagemagick/dist/bundles/magickApi.js';

Notable

Well currently the samples are hosted on knicknic.github.io/imagemagick/rotate however when I updated the code to use the CDN it didn't work

It appears that ublock prevents this cross domain loading of wasm files involving github via easylist uBlockOrigin/uAssets#2309

Additional work

We should at least include in instructions an issue about this loading of wasm files. And in sample code we should detect (via window.location (are we on github.io if so say we should be loading locally rather than cross domain) and raise an alert).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant