We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
scottvorthmann
3 years agoNew member | Level 2
ES modules for the modern web
All of the examples I've found use outmoded global scripts, and your Javascript SDK is not available in ES module form. I suggest you modernize your SDK packaging, and also modernize your examples. ...
scottvorthmann
3 years agoNew member | Level 2
An ES module packaging would allow my app to load the Dropbox SDK dynamically, using now-standard dynamic module imports, which is beneficial since I only need it for certain situations. I could even use it in a web worker, again loaded dynamically.
I attempted to use the Dropbox SDK and bundle my app using esbuild. It failed to resolve "crypto" and "utils". Perhaps this is an issue with your package.json, or perhaps your "module" is just an IIFE that assumes other libraries have been defined globally. Since the introduction of ES modules, it is a bad practice to pollute the global namespace, or to rely on global definitions from other libraries.
Even Node.js supports ES modules, so older types of modules are not necessary. For more info, see:
https://auth0.com/blog/javascript-module-systems-showdown/ (6 years old)
https://hacks.mozilla.org/2018/03/es-modules-a-cartoon-deep-dive/ (4 years old)
Greg-DB
Dropbox Community Moderator
3 years agoThanks for the detailed request! I've sent this along to the relevant team.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!