MiniComps!

minicomps, minimalcomps

MinimalComps2 is dead.

Long live MiniComps!

Yes, MinimalComps2 is being rebranded as MiniComps and is hosted at minicomps.org

The new repo is here: https://github.com/bit101/minicomps

Why?

The name “MinimalComps2” made sense at first. It’s a direct visual re-imagining of the original Flash-based MinimalComps. But some problems arose.

First was the fact that the version naming became awkward. MinimalComps2 version 1.5.1 is bad enough. But I wanted to introduce some breaking changes, which would require releasing MinimalComps2 version 2. Hmm… no.

Second was that I lost the domain name for the original Flash MinimalComps library. Someone created a static copy of the old site and has been hosting it as is for years. I think I remember seeing some dodgy links there, and I haven’t been able to contact the owner, so it’s unlikely I’d ever get it back.

That was surely going to cause some confusion at some point. I’ve linked to the wrong domain multiple times. At this point it’s harmless, but if someone decided to take advantage of that confusion on down the line, it could cause problems.

What’s changed?

Quite a bit. I’ve been refactoring and updating for two plus weeks straight. Most of it should be under the hood – a ton of clean up, making things more consistent across multiple components, some improved practices, stuff like that.

There are some noticeable changes as you use the components though.

  1. If you’re using the global library through a script tag, you’ll need to use the mc namespace instead of mc2.
  2. A few constructors have changed. Window, ColorPicker, a few others. Mostly to standardize the inclusion of text labels.
  3. Speaking of text labels, almost everything that had a text or textPosition property or getter/setter now has label and labelPosition. The exceptions are the actual text-based components – TextInput, TextArea, TextBox, which continue to have text.
  4. Just about every method that isn’t designed to return something will now return the instance that it was called on, so you can chain calls to your heart’s content.
  5. There are more methods in general. Most components relied heavily on get foo / set foo type of accessors, with a setFoo methods on more important items. Now, every single get/set accessor has a matching full method.
  6. The system of setting default properties has changed. Rather than relying on a Defaults module, now each class defines its own defaults. And there are more new defaults. So rather than:
Defaults.hslider.decimals = 2;
new HSlider(...);

You’ll write:

HSlider.decimals = 2;
new HSlider(...)
  1. HBox and VBox have a couple of new methods: addSpace(space) allows you to plug in some vertical or horizontal space wherever you want, and layout() lets you redo the box’s layout – useful if you change the size of a component and want to update the box.
  2. The Toggle component now has labels to indicate the state. You can turn these off or on and specify what the labels are.

In addition to all the code changes, I migrated the whole site over to minicomps.org, updated all the references and all the documentation. And I upgraded all the demos on the site to use the new stuff. The old domain should redirect there now. As mentioned, the repo is now https://github.com/bit101/minicomps. There’s a note on the old one sending people to the new one. I’ll leave the old one up indefinitely though.

You’ve seen me posting a bunch of experiments here over the past few weeks. I’m definitely going to continue to do that and use MiniComps for those from now on. I’ll probably go and backport the existing experiments that use the old ones.

I’ve set the first release to v0.1.0 because I know there are going to be some bugs filtering out after all that refactoring.

Leave a Reply