cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ES modules for the modern web

ES modules for the modern web

scottvorthmann
New member | Level 2

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.  Not only will this improve security, but it will also enhance the public perception of Dropbox among web developers.

3 Replies 3

Jay
Dropbox Staff

Hi @scottvorthmann, thanks for the message.

 

Could you clarify this in more detail on how this would affect your workflow and any examples you can provide on what to improve?


Jay
Community Moderator @ Dropbox
dropbox.com/support


Heart Did this post help you? If so, give it a Like below to let us know.
:arrows_counterclockwise: Need help with something else? Ask me a question!
:pushpin: Find Tips & Tricks Discover more ways to use Dropbox here!
:arrows_counterclockwise: Interested in Community Groups? Click here to join!

scottvorthmann
New 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 Staff

Thanks for the detailed request! I've sent this along to the relevant team.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    scottvorthmann New member | Level 2
  • User avatar
    Jay Dropbox Staff
What do Dropbox user levels mean?