DEV Community

Jan Dvorak
Jan Dvorak

Posted on

Re-creating Meteor original examples - part 1

About a month ago the Meteor examples were removed from the Meteor repository. Honestly this was a long overdue action as these examples pre-dated the 1.0 release and were super ancient and only useful to archeologists. At least on first look.

Some examples could have been deleted out right as they were more for testing a single function (that is no longer relevant since we have CI) or in one case to showcase a functionality even predating Blaze where upgrading it was not worth it. The rest was worth updating. In many ways there were beautiful in their one short js file (in most cases).

First things first. Updating all the way to the latest release (1.12.1) via meteor update was for the most part easy. Occasionally one had to be a bit more patient, but nothing major. After that came things like adding npm and basic packages to make things run. Often this was enough to get the old code running fine (discounting the design), but with the old patterns that was not what I wanted to achieve. When I started to upgrade things along current coding practices it was often much easier to create a new Meteor Blaze project and drop the old code into it.

Parties example

The next step was upgrading the code by adding imports and using ECMA Script features. The older the example the more replacements in code had to be made, but that was for changes before Meteor 1.0. After Meteor 1.0 it was mostly adding imports, separating code into its own client, server and imports folder for collections related stuff. Also not to mention Blaze changes. For me this was a re-acquainting with Blaze.

With these there was a chance for some small initial improvements. For example removing insecure and autopublish and adjusting things accordingly. Also removing jQuery and underscore where feasible.

Words play example

The two most notable examples are the parties and words play examples. There is still a lot more work that needs to be done and there is still one more folder of unfinished examples left.

Currently my plan is to upgrade them to Meteor 2.0 and modernize things as much as possible. But before that I want to get the rest of the examples updated as well and determine which are the best to keep on going. These will then be uploaded to a dedicated GiHub repository to share with everyone and some examples like words play that are more advanced will be uploaded to Galaxy and expanded upon.

Stay tuned for part 2!

If you like my work, please consider supporting me on GitHub Sponsors ❤️.

Discussion (0)