kbin-kes icon indicating copy to clipboard operation
kbin-kes copied to clipboard

[CHORE] Dropping deprecated keys/methods

Open aclist opened this issue 9 months ago • 0 comments

Browser

Firefox-based

Script manager

Tampermonkey

KES version

4.3.0-beta.56

Describe the feature

While preparing the 5.x.x documentaion, I noticed some areas that are obsolete or could be improved upon:

entrypoint key

Mods used to be required to manually set up the name of their entrypoint function in the JSON manifest with this key. This is no longer relevant, as the build scripts automatically insert the key in the global manifest based on the root name of the mod. Even if a mod author adds something for the entrypoint key here, it is ultimately going to be overwritten when the build scripts normalize all of the mod manifests. I think this should be dropped.

depends_on key

See https://github.com/aclist/kbin-kes/discussions/495. This is probably no longer necessary if we are abstracting dependencies into their own files.

catch_reset key

This was originally designed for the resize_text mod, and allows the author to provide an array of numerical input fields that will be reset to their initial value when a reset button (one per mod) is pushed. The rationale was that this singular reset button could be used to restore all of the number fields to ther initial state as defined in the manifest. Now that resize_text uses a different logic, this entire functionality might be unnecessary. Or should it be kept around for some other use case?

Should this be expanded so that any mod can reset all of its own settings, not just number types? If so, why does the author have to provide an array of input fields ahead of time? Wouldn't it be better to set up the logic on the MES side, so that a reset button will always revert all of the mod's settings? If so, could this be changed so that the portion of the manifest asking whether you want to add a reset button is just a boolean option like "reset": true?

safeGM methods

safeGM currently uses the syntax safeGM("method", "other params"), where the first parameter is a stringwise rendering of the desired internal GM method. It seems like it would be more idiomatic and usable to make these actual methods under safeGM, such as safeGM.addStyle("params").

Greasemonkey setClipboard method

There is no clear benefit to using this over the native navigator.clipboard property, and it is more complicated to use. Support for this should be dropped IMO.

Enum syntax

Enums are currently structured as, e.g., Mbin.Microblog. For better conformity and clarity that these are not methods, but enumerated constants, the syntax should be changed to Mbin.MICROBLOG. Similarly for subdomains such as Mbin.Thread.Comments, the final enumeration itself should be capitalized to Mbin.Thread.COMMENTS.

aclist avatar Mar 09 '25 06:03 aclist