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

Is it required to include both scripts in html page? #357

Open
dehghani-mehdi opened this issue Jan 17, 2020 · 2 comments
Open

Is it required to include both scripts in html page? #357

dehghani-mehdi opened this issue Jan 17, 2020 · 2 comments

Comments

@dehghani-mehdi
Copy link

<!-- Automatically provides/replaces `Promise` if missing or broken. -->
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.js"></script>
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.js"></script> 

<!-- Minified version of `es6-promise-auto` below. -->
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js"></script> 
  • What is different between es6-promise.js and es6-promise.auto.js?
  • Is it required to include both scripts in html page?
  • What happens if just include either of es6-promise.js or es6-promise.auto.js?
@yairEO
Copy link

yairEO commented May 4, 2020

I also don't understand from the README what is the difference.
very poor explanation:

Automatically provides/replaces Promise if missing or broken.

That is the whole essence of a polyfill...of course this is what it does, question is what does "auto" means...since every polyfill is obviously "auto" and only applies if internally detected it should apply.

@danielocdh
Copy link

What I found out testing a jsPDF page with IE and looking at the code:

  • es6-promise.auto.js seems to work like any polyfill so promises can be used automatically by scripts that require it, I guess with es6-promise.j you can only use the script implementation manually.
  • including es6-promise.auto.js seems to be enough, including both shouldn't cause trouble.
  • I would only use es6-promise.auto.js, if you need the polyfill that will do it. If you want to manually use the script implementation with either version of the script you can use ES6Promise

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

No branches or pull requests

3 participants