new-xkit / XKit

Fork of XKit, the extension framework for Tumblr
https://new-xkit-extension.tumblr.com
Other
459 stars 135 forks source link

Implement silent update functionality #2131

Open marcustyphoon opened 1 year ago

marcustyphoon commented 1 year ago

In theory, this implements a fourth version number field that, when incremented, causes an extension to be updated without notifying the user (unless they are in force update mode).

Incrementing this field on an extension should do nothing if the user has not yet installed this PR. Once the user installs this PR, the increment should be detected as a silent update.

To be very clear: I have not tested this code at all. I literally have not, as of writing this message, even installed it. If someone could figure out how to test it, that would be great.

I would love to have this functionality to be able to put harder lockouts on all of the currently-does-nothing-on-React scripts without spamming the user with what looks like updates. But reading through this code base's internals is actual torture.

nightpool commented 1 year ago

What do you mean by "harder lockouts"?

On Fri, Aug 18, 2023, 10:58 AM marcustyphoon @.***> wrote:

In theory, this implements a fourth version number field that, when incremented, causes an extension to be updated without notifying the user (unless they are in force update mode).

Incrementing this field on an extension should do nothing if the user has not yet installed this PR. Once the user installs this PR, the increment should be detected as a silent update.

To be very clear: I have not tested this code at all. I literally have not, as of writing this message, even installed it. If someone could figure out how to test it, that would be great.

I would love to have this functionality to be able to put harder lockouts on all of the currently-does-nothing-on-React scripts without spamming the user with what looks like updates. But reading through this code base's internals is actual torture.

You can view, comment on, or merge this pull request online at:

https://github.com/new-xkit/XKit/pull/2131 Commit Summary

File Changes

(2 files https://github.com/new-xkit/XKit/pull/2131/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/new-xkit/XKit/pull/2131, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABZCV4RAMLP7SK3DIBOMMDXV6GJRANCNFSM6AAAAAA3VW4CVU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

marcustyphoon commented 1 year ago

In short:

run: function() {
    if (XKit.page.react) { return; }

    /* etc */
}

I'm not keen on having to do the Old Sidebar (#2116) thing again, and we have scripts like retags that are intentionally not completely deleted only because they work on legacy (#2088) where that behavior would not be ideal, if we want to continue offering the maximum amount of functionality the codebase can deliver.

In general, the ability to push updates guaranteeing that possibly-broken code won't run without appearing the same way a fix would and incorrectly setting user expectations seems valuable to me. That's only worthwhile if the code that enables that doesn't itself break things, though, which I don't know how to test. My track record for bug-free first commits is pretty bad, after all.