Design philosophy going forward #39
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
Jameson
joke
options window
question
Split!
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
sparkle-devs/sparkle#39
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@codingisfun2831t @Bubgamer07 @e016 While commenting on #38, I realized that we don't have any actual design philosophy rules to adhere to, so effective immediately, I will expect all contributors to follow these guidelines going forward. If you see anything that could use fixing, please let me know and I'll edit this comment.
When to change something in Sparkle
You should only change Sparkle's source code in the following scenarios:
Changing code comments is not acceptable unless it's for the purposes of relicensing, or correcting something that is obviously incorrect or contains invalid English. Adding new ones to better-document the source code is allowed, but when possible it should be included as part of a larger change.
You should not fix things that aren't broken.
Scope of Sparkle
Sparkle is an addon manager for Snap! and its forks. In order to get addons to play nice together, Sparkle needs to provide a few high-level APIs; examples include:
cleanupFunc)wrapFunction)options)requireSnaps/disallowSnaps/suggestSnaps)These APIs are provided so that addons have fairly-uniform behavior that's unlikely to cause conflicts, instead of each addon reinventing the wheel in a slightly-different shape, as it would have gone otherwise.
New addon APIs should not be implemented unless any of the following conditions are met:
Examples of APIs that do not satisfy these conditions include the
this.api.inform()function (essentially a small wrapper on top ofthis.ide.inform()) andthis.api.showMsg()(clone ofthis.ide.showMessage()).It's unclear whether or notthis.api.storage.*meets the criteria, so I'm going to give it a special exception for now.this.api.storage.*prevents conflicts between addons and will therefore be kept for the forseeable future.In the following months, I plan on eliminating these redundant APIs and updating addons to use the new, Snap!-native alternatives.
storagefunctions I think are fine. They prevent mod conflicts (prefixed with{id}_). However back when I were first developing Snap!Mods I added those functions as a little API functions since there wasn't much else.Makes sense, I'll update the comment now; thanks!