Posted on Tue 04 February 2014

Meteor meets your text editor

More than a month ago I started working on JavaScript IntelliSense for Meteor. Several days ago I presented it in my lightning talk on Meteor Devshop 11. After getting lots of positive responses on Twitter and the meteor-talk mailing list I continue on improving it. My work brings more intelligent tooling to Sublime Text 2/3, Vim and Emacs when you work on a Meteor app in JavaScript.

There is a simple problem with web development these days: the tooling is lacking a lot of features people had for years: static analysis tools, runtime dynamic analysers, code editors support and others.

Code editor support is especially important as we spend most of our time there: writing and, more commonly, reading and exploring code. Modern IDEs like WebStorm and Visual Studio have accomplished big results in bringing such intelligent support to their costly products. For light-weight editors lovers there is open-source project working on that - TernJS.

Initial email

One day I opened an interesting email from Bondi French to meteor-talk. In his email Bondi asked if anyone tried to integrate TernJS, code-analysis engine for JavaScript, with Meteor. It looked like a good idea to me and I decided to give it a try.

Fortunately, I was on my vacation hanging out on sunny warm San Diego beaches with my good friends, so I had a lot of time to "background process" these thoughts.

Nothing made me so enthusiastic to work on such project like a good time spent outdoors in a good company of friends. It probably was the first time in last 6 month when I got so much sun and spent less than 10 hours a day in front of a computer.

Photo credits to @armansu on Instagram

One day I refused to go to a movie theater with others and sat down for a solid couple of hours implementing an MVP for Meteor + Tern integration: convert type definitions of Meteor public API (using existing work of meteor.ts.d) and teaching Tern basic scoping rules of Meteor.

After my vacation week I found another weekend to finish and test my work. After testing it on a simple app with Sublime Text first, I recorded a simple screencast to show my work to people. The next day I recorded the sequel walking through the installation process for Vim. The same day happy users reported this plugin to work on Emacs as well. I was happy. The MVP worked for people. It worked for me.

Type-based auto-completion with Meteor app

Smart types-based auto-completion, "jump to definition", "find references", documentation look up in Meteor apps worked out of the box, thanks to Tern's flexible plugin system.

To reach the wider audience I proposed my lightning talk and showed off to everyone on the Internet.

I consider it to be pretty successful for a weekend for fun project:

  • It works for my work
  • Everyone on the mailing list thread was excited and supportive
  • The GitHub repo got more than 350 unique views in over the first week

It also got covered by all Meteoric knowledge sources: meteor-talk mailing list, Meteor's twitter, /r/Meteor, Meteorpedia, Meteor Hacks weekly, Meteor Podcast, Meteor Devshop SF, Meteor's Youtube channel. That's hard to miss :).

But it is not over yet! There is a big room for improvements in my plugin! I am already in the process of bringing Meteor smart-packages analysis support, documentation support and bringing the tooling for definitions generation for newer Meteor versions and Atmosphere packages.

Hopefully, this little side project will make a lot more people happier working with Meteor. Alright, folks, I going back to oplog work. Will work on this during next weekend!

© Slava Kim. Built using Pelican. Theme by Giulio Fidente on github. .