-
Notifications
You must be signed in to change notification settings - Fork 490
Why not electron-packager / electron-builder? #172
Comments
Your hunch is correct. Those tools weren't there yet (or were inmature) when I was building packaging process for this boilerplate hence I wrote it myself. I was wondering about switching to electron-packager some time ago, but since I'm very busy now I procrastinated until community pushes me into that direction or even suggest a PR ;). electron-builder looks veeeery promising. Somehow I wasn't aware of this project's existance until today (doh!). This looks like the tool I was dreaming of when starting this project. All contributions/PRs about moving to electron-builder will be greatly appreciated. @black-snow since you're active participant for some time here, and if you have time and willing to help/lead this code change (somehow I have gut feeling it won't be that easy process) we can talk about commit rights for you (hit me up on priv to talk about that). |
Great, I'll do some experiments and report back :) |
I'm excited about this functionality, do you need any help @black-snow ? I'd love to see this get in. |
@blainesch Please feel free to do some experiments and report back your results. The boilerplate does:
Am I missing something? I guess we could swap the build process and still have some additional features that are nice to have. The result would be electron-builder with sensible defaults, helpers and code hotswapping. Neat indeed. On the otherhand I'd mean to swap out like 90% of the boilerplate. Guess we should rather take a look at what people need instead of trying to preserve what we have.
How does your workflow look like? What are your needs? What's bugging you w/ this boilerplate? What's great about it? Should we aim to be a standard tool or rather be an alternative? |
What I wanted to achieve starting this project is to have... a boilerplate :D And this approach turns out to be liked by people. So.. as long as people will get the app they can install, they don't care what tool was used under the hood to produce this installer. They're just interested in their app code. Will have a little time this week, and do my own research on electron-builder. |
I think there's absolutely value in having a boilerplate built around electron-builder, or at least a wizard/installer. builder's setup steps are finicky. |
@szwacz can you give us a branch to work on this? |
@black-snow there you have it: |
And what are your impressions of Anyway do you have any success with it? |
I'm actually using it in production and it's running pretty great. Sadly I haven't yet found the time to hack on this :| |
@black-snow any chance you could try adding it on to the boilerplate? Keen to get auto-update working. Would also really love to hear your learnings/gotchas that devs need to be mindful of whilst using electron-builder in production. Thanks much. |
I tried electron-builder + electron-packager some time ago. In fact I discarded electron-boilerplate in favor of them only because of autoupdate feature. |
Im using electron-builder and theres be no issues so far, infact its great. |
Alright, let's start with this. The first key-difference is that electron-builder uses different directories. electron-builder requires (by default):
By default electron-builder has no tasks that run before building the installers. We'll most probably want to keep some of our tasks (things like rollup, babel-stuff, ....). On one hand I think it'd be good to stick to electron-builder's defaults. On the other hand that would mean that what's Rewriting the paths for those directories is a piece of cake and can be achieved via the Another question is what to choose as default build targets. electron-builder will - in contrast to the boilerplate, I think - drop older releases when running |
I second, changing the default directories, as opposed to changing the project to use the default directories. However Id push for using Squirrel as the default. You dont need to do the auto-updating stuff and it's installers is the most straightforward no hassle approach. I'd also suggest the use of https://www.npmjs.com/package/electron-squirrel-startup to generate the shortcuts on Windows. |
Folders... Installers... Linux... |
NSIS outperforms Squirrel.Windows in all aspects, only electron-userland/electron-builder#529 is the reason why
5.12.1 should be production ready. But yes, it is not yet time-proven.
Consider use
No, you don't need to instal NSIS — pre bundled for macOS, Linux x64 and Windows. |
You can file issue about it. Why electron-builder does it? Because if we need to build delta patch, we must use valid previous version. No one can guarantee that file in your |
FYI: to build Linux on Windows we provides docker image — https://github.com/electron-userland/electron-builder/wiki/docker (yes, it is for advanced users). |
@develar hey there, thanks for checking in Switching our default from squirrel to nsis shouldn't be a big deal once nsis is ready (with auto updates). @develar Maybe I'll file an issue. I see why electron-builder throws away the most previous build but it seems to drop everything from the output directory. Let's assume I have versions 0.0.1, 0.0.2 and 0.0.3. When I |
Yes, but until
electron-userland/electron-builder#472 (comment) NSIS just much better.
For what do you need old artifacts? |
@develar thanks again for your reply. I'll file an issue so that we don't "pollute" the discussion here. |
@develar welcome author of electron-builder :) Thank you for all your insider info. Very helpful stuff. Question to discussion participants. Has anyone something done already about this boilerplate and electron-builder? I hope to have some time to work on it this weekend, but would be shame to re-doing steps already done by some of you folks. |
Hi guys, I was following this issue since it started and I guess I can help now. |
Here it is: https://github.com/fedegratti/electron-boilerplate/tree/add_eletron-builder Some considerations:
I hope it helps! |
Packaging with electron-builder works on branch https://github.com/szwacz/electron-boilerplate/tree/packaging-rework Still icons for linux doesn't work. Do I have to have all those icon resolutions? |
No. If you auto transform macOS |
@black-snow as I said in the PR I believe we still need this install/rebuild native modules. |
@develar I feel like when I was using electron-builder native modules were handled automagically in dev mode as well in the releases. Can you confirm this? I guess |
This required only to install app deps when you execute electron-builder doesn't use it on build — if two-package.json structure is used (electron-boilerplate uses it), we call |
Awesome, so boilerplate codebase shrinks more and more. |
I'll get to use the boilerplate/ builder-branch on my current project so I can gather some experiences on what might be missing over the next weeks ;) Are we missing anything else for now? |
Great, but this code actually already has feature-set of previous version of the boilerplate, so can be released. And I will do it after final round of testing on weekend. Then we can move to auto-updates. |
Not sure of a better place to ask this question, and I think this issue seems most appropriate. I have an existing project I've been using the original boilerplate with (as of about a month ago). How easy/difficult will it be to migrate to the updated boilerplate that works with builder? I've made a few customizations to the scripts and such from the boilerplate, but nothing that I couldn't reworked or even eliminated based on a new structure. |
@mattzuba greatly depends on how much you've customized your setup I'd say. Your stuff inside |
Great, thanks! I only customized the NSIS script a tiny bit, but not much, nothing that I can't figure out how to do without it. Looking forward to seeing this integration complete! |
This work just landed in the master branch. Thank you all for help! |
Thumbs up |
Hey szwacs, I'm currently working on #149. Seems like most tools (e. g. this) are tailored to electron-packager. I wonder why we aren't using electron-packager within the boilerplate.
Was it just too new or didn't exist back then? Are there any advantages in favouring NSIS etc.?
I think we should consider / discuss moving to electron-packager / electron-builder.
On a first read electron-packager sound familiar for it's suggesting the "Two package.json structure". Our
release
directory seems to be pretty much what'sbuild
there.PS: I don't think that my app has outgrown this boilerplate yet. And even if that was the case it'd be way easier dropping the boilerplate if it was using the "common build process".
The text was updated successfully, but these errors were encountered: