how do you alter a framework (starling) but stay organized and keep getting updates?

what is the proper way to customize the source code with something like starling, but still download the latest versions without overwriting your changes?

is there some way to put all modified functions somewhere seperate and inject them as override functions?

That’s a pretty good question tbo.

Even here at kirupaForum, we run into this. It’s best if you can keep changes to separate files. For example, you might want to keep your changes in a subclass of whatever Starling class you’re modifying, if that’s an approach that works with the changes you’re making. (The kF example is that we remove EnsureDbConsistency.rb whenever the Docker container is rebuilt, because something in that file causes permanent high CPU usage.)

The problem with version control systems like Git are that they don’t understand programs at the semantic or even syntactic level which you’d need to implement something like what you’re suggesting in your post here. Git just operates on files and strings, and can tell you various things about which lines have been changed.

In AS3, you have include, import, and namespaces. If Starling natively used include in a lot of places, you could probably finagle a workable system out of that. I don’t think it does, though, so that option is out.

You have options like git patches, but they can be tricky because they rely on Git’s blanket assumption that file changes are really what matters, rather than more detailed edits like modifying a method.


If you can spare the time, it’s probably best to just keep track of what changes in Starling, and adjust your own code to match. Your own modifications can stay the same as long as you know how to apply them to knew releases and know that they won’t have broken anything new.

Not by default. If you want to be really sophisticated, you could build some infrastructure around this related to git hooks which invoke some static analysis of your programs and libraries, but that’s far outside the realm of things that I’ve seen people doing with AS3 on any consistent basis.

I suppose a rudimentary include could override things in certain classes which you know often have things you need to override.

sounds like realistically it has to be a manual process each update.

It can be. OTOH, you can just assume that your updates are the best, and only look at things when they break. We removed the EnsureDbConsistency cron job, which could theoretically break the entire forum depending on how the Discourse authors use it, but pragmatically we can assume that most changes won’t actually break it.

It’s like any sort of jury rigging, where you assume that you know better than existing infrastructure. A bet, for sure, but often one that you can feel confident about.