Can I distribute two different versions of an extension for mobile and desktop under the same add-on?

Hello,

I have an extension project with two branches for mobile and desktop, I want to publish both of them together and that users on the mobile will get the mobile version and people of the desktop get the desktop version. The way I did it 'till now is publishing version let’s say 0.4 for mobile and then 0.5 for desktop, I don’t think it is the way to go and I’m pretty sure there is a better way to manage this.

Thank you for your help,

Ideally you should be using the same file for both, and conditioning the code that is specific for each platform.

1 Like

Thank you for your response,
I’m kinda surprised because that sounds problematic, what if my desktop add-on has a heavy react client and my mobile add-on is just a slim background process?
I don’t think I can eliminate source code with conditioning…

Are you concerned about the bundle size and the code evaluation time of your extension?

Mainly the bundle size.
It’s not a theoretical question, I experienced this exact situation and had to remove the visual client from my add-on so it would be compatible with mobile, as mobile add-ons have stricter limitations when it comes to size (if I remember correctly, it wasn’t recently).

1 Like