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

Use native promise and global export #1

Closed
wants to merge 2 commits into from
Closed

Use native promise and global export #1

wants to merge 2 commits into from

Conversation

ffflorian
Copy link

@ffflorian ffflorian commented Apr 3, 2018

Hi @raphinesse,

thank you for creating dexie-batch!

At Wire we would love to use your tool in our web app, but since you are using the (in Dexie >= 2.0 deprecated) Dexie.Promise function and module.exports without distributing a packed version, it's not working for us (and probably many others).

We'd love to see this tool in action with native promises and in the browser, what do you think?

Also see: dexie/Dexie.js#317 (comment).

@ffflorian ffflorian changed the title Use native promise Use native promise and global export Apr 3, 2018
@raphinesse
Copy link
Owner

Hi, first of all: thanks a lot for taking the time to contribute. It's good to hear that you like dexie-batch.

Regarding usage of native Promises: I could not find anything about the deprecation of Dexie.Promise in the thread you linked to, nor in the docs. On the contrary, the docs say:

In the case you write a library (not an app) and you want your library to work on old browsers without requiring a Promise polyfill, it is still safe to use Dexie.Promise

Regarding exporting as a global: I am open to do that, but only while maintaining module support, because that is the state of the art. Unfortunately, the change you propose drops module support and in doing so, breaks all tests.

What exactly is the nature of your underlying problem? I guess using dexie-batch without a module bundler?

@raphinesse
Copy link
Owner

If you want to have DexieBatch available globally by just including a script, try including the following after the <script> for Dexie:

<script src="https://gist.github.com/raphinesse/7bf44bf66877473b1ddc59a1c2f0468b.js"></script>

Would providing a download to such a script resolve your issue?
Please let me know, so I can add an automatic build.

@raphinesse
Copy link
Owner

Any news on this @ffflorian? I got some time on my hands right now. But that will probably change in a few days.

@raphinesse
Copy link
Owner

If this should not be solved for you in v0.4.0, please let me know.

@ffflorian
Copy link
Author

@raphinesse
Sorry for the late answer - it is working perfectly for us. Thank you! 🙂

@ffflorian ffflorian deleted the native-promise branch July 17, 2018 13:36
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

Successfully merging this pull request may close these issues.

2 participants