Package Manager, how we won't miss thee

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Package Manager, how we won't miss thee
« on June 22nd, 2011, 06:12 PM »
The question about the package manager, SMF mods in general, still haunts us. I recently proposed what I want to do about it to the private board, and now I'd like to expand on that and put it in general terms for everyone; my proposal was more technical than general in nature. Besides, I figure that you want to see not only where we are but a few thoughts and insight into where we're going. (That's what the blog's for, right? :lol:)

SMF's package manager is an interesting artefact, and certainly more than a nod to what came before. But we're bidding it farewell in Wedge, to be replaced with a very different beast, even if it looks similar on the surface.


The Add-on Manager. It sounds nicer than package manager, and it implies its purpose better; packages don't just have to be new functions even in SMF, they can be packs of avatars, language packs and so on, whereas an add-on is physically a new thing added on to the core.

In many ways it's more than just a change of name, it's also a change of mindset: the add-on manager does not allow add-ons to modify files AT ALL. I'm not just removing the functionality from the existing package manager, I'm actually implementing a whole new branch of code to replace it, every aspect is being gutted, torched and rebuilt. It means you're never trying to break old habits, you start out by learning better ones from the word go. It also means that SMF mods will have to be rewritten, but honestly, that's a blessing rather than a curse.

No permissions issues where you have to open up all your files to higher permissions than they needed. You'll even be able to add and remove packages simply by uploading folders and removing them, without risking it just breaking randomly - but you'll have to visit the admin panel to enable it, of course.

It's also much smarter: instead of this version emulate madness and tying it to versions, the process is much closer to feature detection - add-ons declare the facilities they need to be able to use, and if those needs are met, it can be activated. (Add-ons can even, if they so wish, declare that they provide certain facilities, and other add-ons can indicate they want to use them, so you can build add-ons that have implicit dependencies)

Also if a plugin has specific requirements such as obscure PHP extensions, these can be indicated in the package itself preventing installation without them.

Naturally, all this stuff will be available through whatever we come up with as an add-on repository, so it becomes much clearer as to what's needed and what works with what.

Just for an encore, the add-on management will be able to figure out what languages are supported in an add-on, so we can also display that on the add-on repo, as well as displaying it in the core.


Add-ons will live in their own folder, which I expect to call Addons (and removing the old Packages folder), one folder per add-on. That way, a plugin's functionality is self-contained rather than filling up the Sources and Themes/default/languages folders with stuff.

Now, all this sounds wonderful, too good to be true in fact... except it isn't. It's not only workable, but a slimmer, less refined version is even built in to SimpleDesk 2.0 and has been since I prototyped it a year ago. I've learnt some lessons since then, some refinements to that design, and some of the changes we've made in Wedge make it possible to really do it justice.


I won't get into the innards right now, other than that Modifications.*.php files will be disappearing, that the add-ons still use XML to relate their details, much like package-info.xml but nicer, and that it'll have more in common with WordPress' plugins area than SMF's package manager.

I'll release a few more details once I'm comfortable and can show you a bit more about how it works.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Re: Package Manager, how we won't miss thee
« Reply #16, on June 24th, 2011, 01:07 AM »
Yeah, I had no intention of mimicking it, so many ways it can be improved upon it isn't funny.
Posted: June 24th, 2011, 01:03 AM

OK, I promised a copy of SimpleDesk's plugin screen, and something based on this is what's being built into Wedge. Imagine this hybridised with MyBB's and WordPress's and made less fugly at the same time.

📎 plugin_manager.png - 20.16 kB, 640x293, viewed 242 times.


Re: Package Manager, how we won't miss thee
« Reply #17, on June 24th, 2011, 01:12 AM »
Looks a lot like the "Core Features" page! (I'm not implying that it is at all the same thing, but it does.)

One thing I noticed that is unintuitive with the "Core Features" page is that when you press one of the buttons to make it "On", you assume that it's turned on, and go on to another page, while indeed, you have forgotten to save! I was fumbling around a bit when I tried turning on Advanced Profile Fields and didn't understand why it didn't actually activate when I had clicked it a few times. :)

Re: Package Manager, how we won't miss thee
« Reply #18, on June 24th, 2011, 01:15 AM »
Quote
Looks a lot like the "Core Features" page! (I'm not implying that it is at all the same thing, but it does.)
I can't imagine why ;) Yes, when I wrote that one a year ago I shamelessly ripped it off from Core Features. And it still suffers from the same unintuitive behaviour that Core Features does. This is, amongst other things, one of the lessons I learned since building this originally.


Re: Package Manager, how we won't miss thee
« Reply #20, on June 24th, 2011, 01:25 AM »
Even simpler... just turn off Javascript. There's actually an entire non-JS workaround implemented but I doubt anyone's ever seen it.

But this is one band-aid that I daren't add. Either this is done, fully, or we don't bother with it at all and leave it as it is - there's actually no room on this one for band-aids.

Re: Package Manager, how we won't miss thee
« Reply #21, on June 24th, 2011, 01:36 AM »
Well, just replacing the image with an image of a checkbox will make it like 50% more intuitive and won't make a lick-a difference otherwise. But I do agree that something done right is better than something done halfway.

Like this:


Re: Package Manager, how we won't miss thee
« Reply #22, on June 24th, 2011, 01:39 AM »
Oh, definitely, I'll agree with that. But this is the sort of thing where we have the opportunity to break from years of established behaviour and I'm going to grab it with both hands :D

(Btw, Core Features will be beaten into submission and removed at some point.)

Re: Package Manager, how we won't miss thee
« Reply #23, on June 24th, 2011, 01:53 AM »
I don't think I'll miss it much. Again i have to come back to Drupal, where a lot of what is here called core features are modules, like, on fairly even level with other "plugins". This seems to me to be a very good system.

(Hehe, sorry for constantly mentioning it, but this conversation really reminds me of it. Here's why:)



(Ignore the random text marking.)


Re: Package Manager, how we won't miss thee
« Reply #25, on June 24th, 2011, 01:58 AM »
Quote from Arantor on June 24th, 2011, 01:55 AM
I am not going to use checkboxes. It does not work structurally or logically for the processes required by Wedge.
Hehe, now you're just making me more curious. ;)

But I'm sure you have a good idea of what you're doing. At least from your other ideas and posts your head seems screwed on right.


Re: Package Manager, how we won't miss thee
« Reply #27, on June 24th, 2011, 11:00 AM »
Re: plugin repo -- it will be based off Aeva Media (well, the Wedge Media component, technically.) Any features I will write to make it behave more like a plugin repo will be available in Wedge as well, either as core, or as a plugin. As for SMF's plugin repo, I don't think it would take me more than a couple of days to build something that's actually better than theirs...

Re: core features page. The Save button is also something I totally missed the first times. I completely agree that it's a big usability mistake. I didn't touch it because I figured most people would be used to it by now. However, now that I see I'm not the only one -- I guess it needs to be changed. But Pete already has plans about this so I'll leave it up to him... :)
(Also, the checkbox stuff shows up on first page load when you go there. Just for a second or two...)

Re: Package Manager, how we won't miss thee
« Reply #28, on June 24th, 2011, 11:08 AM »
The biggest thing that a plugin repo needs to be able to do is harvest the meta data from the XML file in the package and process it. The reality is that whatever process there is for publishing a package (be that upload, or build from SVN or similar, or whatever), that just has to process the XML and display that information alongside the download.

Re: Package Manager, how we won't miss thee
« Reply #29, on June 24th, 2011, 11:16 AM »
Since you are working on Package Manager, perhaps also add something like dependency to other packages in the repository or package itself, similar to linux's repositories. Can come in handy.

Re: Package Manager, how we won't miss thee
« Reply #30, on June 24th, 2011, 11:25 AM »
Actually, there is, and I did mention it before, at least what I thought of doing.

Since the very idea of versioning is... awkward... I thought of something closer to home, so to speak.

An add-on's manifest file states what hooks it requires in order to work, plus it indicates what functions are required in order for it to work. (It also has the facility to demand a PHP and MySQL version if that's relevant, e.g. MySQL 4.1.2 is currently the minimum but I have a plugin where I explicitly need MySQL 5.0.3. Unlike other things, there are different behaviours between PHP and MySQL versions that you can't necessarily validate through testing existences of things)

There's also the facility for an add-on to indicate that it provides new hooks, too. That gives you an implication of dependency but not based around versions, but facilities made available.

While yes, I could build in version requirements, I find them more a hindrance than a help - the best example I have for this is SMF itself, with mods stating versions that they are compatible with, rather than whether they are actually compatible without having to update just to patch a version number.