Add an option to upgrade an existing app (fix #1131)#1138
Conversation
ronjouch
left a comment
There was a problem hiding this comment.
Hi there. Great job; here's a first review but I'm tired, I'll do a second one probably during the weekend. Finishing this first review to chat about three things (apart from the nits):
- There are lots of new testable things. If you have the time to add tests where you feel it's worthwhile, that would be awesome. (Not asking for 100% coverage; this is just a little push to have some more tests up to you where you feel they're valuable).
- The comment about
nativefier.jsonstarting with "Here and everywhere else: you're going to great lengths" - Given that
--upgradewill upgrade the Electron version,- I'd like an early
log.infowarning about it. Something like "Your old app will be upgraded using Electron " - Electron version conditions the userAgent string, which lives in
nativefier.json. So, a new userAgent should be determined from it. Am I seeing no mention of it because it naturally works and is part of the options that are destructured/spread, or does it need more work?
- I'd like an early
Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
|
@TheCleric also, a ping about the comment of the whole PR, which I'm not sure you have seen:
|
|
@ronjouch sorry. I did see your comment, I apologize I didn't respond to it. Life's been a little hectic, but I'll get back to addressing what you wrote soon. I know the ball is in my court at the moment. 😄 |
|
@TheCleric no worry, there's no rush, and good luck with Real Life™. Ping me to send the ball back to me. |
|
Alright @ronjouch I THINK I've addressed your concerns here. In my latest commit I've:
Sorry for the long timeline between this pr and this update. Let me know if I accidentally left anything unaddressed. |
ronjouch
left a comment
There was a problem hiding this comment.
Alright @ronjouch I THINK I've addressed your concerns here. In my latest commit I've:
- Added more log.debug statements
- Added some integration testing
- Try to save off more to the nativefier.json file
- Try to reuse anything present in the nativefier.json file before doing things like detecting the os and arch
@TheCleric thanks, great work 👏 . I have two remaining questions. Also, warning, if you do more work, pls pull, I pushed a merge and a few nits to your branch.
|
@TheCleric I gave it a try, and there's something I don't understand:
Expected: app is upgraded to the latest Nativefier Actual: logs say it will bundle Electron version The starting point of this feature was to let users facing our "old build" warning easily upgrade an existing app, "upgrade" being defined as:
Am I missing something? |
@ronjouch You are not. I will look into this. This was working at one time, but I may have made a mistake in later checkins. |
|
Alright @ronjouch this should be in better shape again. As well I added some tests to the integration tests to ensure these things occur. |
|
@TheCleric thanks. I tested with your last commit, and there's one more thing that is unexpected to me: the upgrade results into a new app written to the current folder. I assumed an upgrade would be in-place: writing to where the current app is, so that once the upgrade is run, there's nothing to do and you just have to run it as usual. But that's just my assumption. → Was it intentional to instead write to the current directory? If intentional, I'm not fundamentally about it (maybe it's better, actually: avoiding access rights trouble maybe? Other reasons?), but pls clarify it in the doc. Right now, when I read
, the "upgrade it" bit makes me think it's in-place. |
@ronjouch you raise some good points. Not doing it in place was intentional for two reasons:
I'm flexible on either of these, or at the very least providing better documentation of the behavior so the user can know what to expect. |
No worry. Expectations vary.
👍! Alright with your approach, then.
Yes please to an explicit paragraph in the doc (and in --help if this doesn't make it too long). |
Exactly I'd rather to have nothing else to do/configure once I upgraded the app. I don't like the fact that when I update the app, It doesn't remove the old one and it creates a new folder, it feels weird to have 2 version of the same app. Btw Thanks @TheCleric for this PR and @ronjouch for this awesome CLI tool! 😄 |
I think we could do this optionally with |
|
@divlo thx for chiming in and adding your voice confirming the expectation to upgrade in-place feels natural. @TheCleric regarding an
Lots of back-and-forth on this one, I know. Thanks for the patience and keeping up. |
@ronjouch sorry, I was thinking of
So here's some bonuses I'd like to see, but I'm not going to push hard for:
@ronjouch sound right? @divlo would this fall in line with your expected user experience? |
|
Currently I'm using But now that I've got this warning, it got me thinking again, I searched through issues/PRs to find how to update Electron/Chromium with Ideally as discussed in #1131, we could automatically update to the latest version of Electron/Chromium like most browsers do, like Google Chrome. The
Thanks for asking! @TheCleric |
👍
👍. Nit regarding 1: I'm not sure we want a "big fat warning": this may sound scary, but again, it's already today's Nativefier job. An extra log, sure, but it doesn't have to be big / all-caps scary.
I don't think that's desirable/necessary:
--Answering to this point on its own for the sake of answering, but as discussed above, if there's no prompting, there's no need for an extra |
@ronjouch My use case for the two above revolve around telling the user "Hey you might want to back that up in case this goes sideways. You did back that up right?" but it seems like I may be leaning towards being too cautious here (and towards a potentially poor user experience). I'll implement what we've agreed to. |
@TheCleric got it. Let's add a bit of wrapping around potential early sharp edges of the new (and maybe buggy) feature, then, but somewhere that's not impacting the expected flow:
|
|
@ronjouch What do you think is necessary for :
I could maybe try to implement it and open a PR for that, of course only when this PR has been merged, what do you think ? |
@divlo thoughts:
|
|
Right, sounds good to me! 👍 |
|
Alright @ronjouch I'm hoping we're at the point where everyone is happy. :) |
ronjouch
left a comment
There was a problem hiding this comment.
Looks good and behaves as expected in a local test.
🎉 🎉 🎉 🎉 🎉 🎉
…tivefier#1138) This adds a `--upgrade` option to upgrade-in-place an old app, re-using its options it can. Should help fix nativefier#1131 Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
* Add ability to inject multiple css/js files * API doc: Move misplaced macOS shortcuts doc (PR #1158) When I added this documentation originally, I guess I placed it in the wrong location. * README: use quotes in example, to divert users from shell globbing pitfalls Follow-up of #1159 (comment) * Support opening URLs passed as arg to Nativefied application (fix #405) (PR #1154) Co-authored-by: Ronan Jouchet <ronan@jouchet.fr> * macOS: Fix crash when using --tray (fix #527), and invisible icon (fix #942, fix #668) (#1156) This fixes: 1. A startup crash on macOS when using the `--tray` option; see #527.  2. Invisible tray icon on macOS; see #942 and #668.  Co-authored-by: Ronan Jouchet <ronan@jouchet.fr> * API.md / --widevine: document signing apps to make some sites like HBO Max & Udemy work (fix #1147) * Prompt to confirm when page is attempting to prevent unload (#1163) Should alleviate part of the issue in #1151 * Add an option to upgrade an existing app (fix #1131) (PR #1138) This adds a `--upgrade` option to upgrade-in-place an old app, re-using its options it can. Should help fix #1131 Co-authored-by: Ronan Jouchet <ronan@jouchet.fr> * Bump to Electron 12.0.5 with Chrome 89.0.4389.128 * Add newly discovered Google internal login page (#1167) * Fix Widevine by properly listening to widevine-... events, and update docs (fix #1153) (PR #1164) As documented in #1153, for Widevine support to work properly, we need to listen for the Widevine ready event, and as well for certain sites the app must be signed. This PR adds the events, and as well adds better documentation on the signing limitation. This may also help resolve #1147 * Improve suffix creation + tests * API: clarif in existing doc by the way * Typo Co-authored-by: Ronan Jouchet <ronan@jouchet.fr> Co-authored-by: Ben Curtis <github@nosolutions.com> Co-authored-by: Fabian Wolf <22625791+fabiwlf@users.noreply.github.com>
…tivefier#1138) This adds a `--upgrade` option to upgrade-in-place an old app, re-using its options it can. Should help fix nativefier#1131 Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
…1162) * Add ability to inject multiple css/js files * API doc: Move misplaced macOS shortcuts doc (PR nativefier#1158) When I added this documentation originally, I guess I placed it in the wrong location. * README: use quotes in example, to divert users from shell globbing pitfalls Follow-up of nativefier#1159 (comment) * Support opening URLs passed as arg to Nativefied application (fix nativefier#405) (PR nativefier#1154) Co-authored-by: Ronan Jouchet <ronan@jouchet.fr> * macOS: Fix crash when using --tray (fix nativefier#527), and invisible icon (fix nativefier#942, fix nativefier#668) (nativefier#1156) This fixes: 1. A startup crash on macOS when using the `--tray` option; see nativefier#527.  2. Invisible tray icon on macOS; see nativefier#942 and nativefier#668.  Co-authored-by: Ronan Jouchet <ronan@jouchet.fr> * API.md / --widevine: document signing apps to make some sites like HBO Max & Udemy work (fix nativefier#1147) * Prompt to confirm when page is attempting to prevent unload (nativefier#1163) Should alleviate part of the issue in nativefier#1151 * Add an option to upgrade an existing app (fix nativefier#1131) (PR nativefier#1138) This adds a `--upgrade` option to upgrade-in-place an old app, re-using its options it can. Should help fix nativefier#1131 Co-authored-by: Ronan Jouchet <ronan@jouchet.fr> * Bump to Electron 12.0.5 with Chrome 89.0.4389.128 * Add newly discovered Google internal login page (nativefier#1167) * Fix Widevine by properly listening to widevine-... events, and update docs (fix nativefier#1153) (PR nativefier#1164) As documented in nativefier#1153, for Widevine support to work properly, we need to listen for the Widevine ready event, and as well for certain sites the app must be signed. This PR adds the events, and as well adds better documentation on the signing limitation. This may also help resolve nativefier#1147 * Improve suffix creation + tests * API: clarif in existing doc by the way * Typo Co-authored-by: Ronan Jouchet <ronan@jouchet.fr> Co-authored-by: Ben Curtis <github@nosolutions.com> Co-authored-by: Fabian Wolf <22625791+fabiwlf@users.noreply.github.com>
This adds a
--upgradeoption to upgrade-in-place an old app, re-using its options it can.Should help fix #1131