Folks, I’ve been an avid MeteorJS learner and have been super excited for it. I’ve been using it for a few months now and by no means am I a MeteorJS master. I see this as an opportunity to share some ideas (which, treat them as abstract / conversation starters, please).
I’ve been a long time user of SilverStripe and have loved their ORM approach with built in class methods. You define the db, run /dev/build, the fields / relations get added to the db (kind of a rake migration task) Once defined there, a basic scaffolding with admin views is already in place, and you have the ability to edit the summary fields (columns in index tables), override / add custom fields to the CMS view with great ease. It’s offered by far the fastest building of user friendly admin interfaces for clients, which just work.
Now, obviously, doing the same in Meteor at once would be a stretch but the building blocks are there. We also need to figure out subscriptions and at the same time perhaps discuss abstraction from the specific database, which I feel is a great drawback. It also feels that architecture-wise locking down approaches and technology while other libraries keep popping up, Meteor needs to stay extremely lean and open to new libraries coming in (e.g. ReactJS, Angular - which I thought, opening their arms to it, MDG did a great job). Reactivity, done in a (seemingly) simple approach, is probably the most exciting quality of Meteor, to me, the rest are just layers.
I’m going to share some thoughts on what an ideal framework would do for me, based on my years of working with SilverStripe:
I imagine defining each object / document as a class, with pretty much everything you would need. It would control subscriptions, if the object needs to be reactive, a custom getter/setter (so e.g. you could fetch some stuff from a custom source)
E.g.
Car = { schema: { // db fields } adminFields: { override/customize admin fields } permissions: { canCreate() canEdit() canView() } subscription: { // is it reactive or not, additional conditions... } serverMethods: { // class methods only seen by server } niceTitle() // a custom getter/setter in the client, with filters if needed yaddayadda somePublicMethod() // eg. to use in the templates }
And then you would do:
myCar = Car.find() (like we’ve been doing it, with all collection methods being readily available)
and in a template, {{ myCar.Title }} etc.
Based on what I’m seeing, Meteor goes steps forward, got awesome buzz initially at rollout, implemented an approach which now seems a little isolated (MongoDB, no hooks for a solid (or multiple solid) CMS’s tightly integrated into the methodoloy) – then some other library comes up, which does a portion of the job of the framework better – and effectively rendering recent development work obsolete (e.g. now that MJS is moving to React, I am wondering what the awesome folks at ReactionCommerce will need to go through to bring it up to speed, instead of focusing on building features).
So I see two things could happen: a) a systemic, holistic, lean re-factoring happens which tightens what it’s been missing and it gets a ton of new followers and with it MeteorJS becomes the de-facto developer friendly reactive framework, for any JS / Node or former PHP afficionado, or Angular / React genius out there or b) stays isolated, in which case, I feel it will just slowly fall into oblivion. I feel the second one is unlikely, but for that to happen a systemic methodology discussion needs to take place – and above all, everything - or, nearly everything, needs to be built as abstract as possible to be replacable easily when better technologies come. I am sensing that somehow MeteorJS is still considered a “toy” - and I really don’t see a reason for it, apart from (my guess?) the fact that it’s missing the openness (out of the box) to integrate with enterprise-level services / databases etc.