Previewing Telescope's Big Refactor
Things have been quiet around here lately, but that doesn’t mean Telescope hasn’t seen activity, on the contrary.
For the last few weeks I’ve been busy completely refactoring Telescope’s codebase. The refactor (v0.20rc) focuses on three main areas: a new architecture, new APIs, and new documentation.
The 5-Minute Overview
I made a short screencast to introduce the main changes. Or you can read on if you want a more detailed version.
Telescope Refactor Preview
One of the main reasons for the refactor was to switch to a 100% package-based architecture, in other words, the entirety of Telescope’s codebase now lives in Meteor packages.
While these packages are not yet published, once they are you’ll be able to:
- Install Telescope into any Meteor project with
meteor add telescope:core.
- Add and remove Telescope themes and plugins with
- Update Telescope with
meteor update telescope:core.
And as we keep working towards making Telescope more flexible and more modular, I can imagine a point where you’ll be able to
meteor add Telescope to existing Meteor apps as well.
Another benefit of this new architecture is the complete elimination of Git from the install and update workflow. This means both a much easier installation process, as well as the end of merge conflicts every time a new release of Telescope comes out.
User & Developer Workflows
As soon as all packages are published, regular users will be encouraged to
meteor add telescope:core instead of cloning the Telescope repository.
If you’re a developer and want access to the Telescope source code though, you’ll still be able to do so by cloning the repo since it includes all internal Telescope packages in its
The other part of the refactor was a complete rethinking of Telescope’s internal APIs. They’re now namespaced and more consistent, which will make it a lot easier to customize your app.
Telescope is also even more flexible than before. As an example, it’s now possible to add custom fields not only to posts, but also comments and users as well.
Finally, Telescope’s codebase is now documented using JSDoc, which makes it possible to automatically generate code documentation.
Please refer to this post.
Updating to the refactor might require a little bit of work, especially if you’ve heavily customized Telescope, but I’ll do my best to help. And if you find any bugs while testing, please leave an issue on GitHub.
Provided we can get enough people testing this release candidate, hopefully we can merge it into
master within the next few weeks!