gmail.js icon indicating copy to clipboard operation
gmail.js copied to clipboard

Is it possible to use gmail.js without browserify and code minifiers?

Open guzman-rc opened this issue 2 years ago • 6 comments

We have developed an extension for Firefox and we want to submit to addons.mozilla.org. The validation process of an extension becomes very complicated when code generators like browserify have been used. https://extensionworkshop.com/documentation/publish/source-code-submission/

guzman-rc avatar Mar 21 '22 13:03 guzman-rc

You can use other similar tools, like esbuild. Minification is strictly optional and not required at all.

Not using bunglers can be done, but has historically lead to issues with ensuring a proper loaded state, which is why that it’s no longer recommended.

josteink avatar Mar 21 '22 15:03 josteink

Thank you very much for your quick response.

My question is focused on whether it is possible to use gmail.js without using any packaging or code generation tools (browserify, webpack, parcel, esbuild, etc) loading the Gmail JavaScript API (https://github.com/KartikTalwar/gmail.js/blob/master/src/gmail.js) instead of the generated file: /dist/gmailJsLoader.js after the execution of the command: npm run build

guzman-rc avatar Mar 21 '22 16:03 guzman-rc

Do whatever you like. But if you don’t use bundling, you need to create a way to confidently ensure gmail.js loads early and is initialised correctly.

Seriously though. Everyone does bundling. All modern ES-based tooling works that way. Bundling is not an obstacle to AMO inclusion.

Just skip minifying the code and the reviewers should be happy.

josteink avatar Mar 21 '22 17:03 josteink

But the generated file /dist/gmailJsLoader.js contains minified code at the beginning and end of the file and the AMO reviewers have unpublished the extension for this reason.

guzman-rc avatar Mar 21 '22 17:03 guzman-rc

That’s being sorta backwards of them. Check out historical revisions of README.me for a bundler-free approach, or try a different bundler like esbuild, snowpack etc.

josteink avatar Mar 21 '22 18:03 josteink

Ok thanks a lot for your help. Regards from Spain.

guzman-rc avatar Mar 21 '22 18:03 guzman-rc