Next steps on Blaze and the view layer

…then we would love it if you started by contributing to Sideburns, now called “Blaze React.” Blaze React’s plans are bigger than you describe there. As one of the 2 main contributors, we have a plan which achieves more than just being a renderer for Blaze 1. The plan is:

  • render current blaze perfectly
  • render a components based blaze perfectly (Similar to @mitar 's “Blaze Components”)
  • the choice to permanently transpile your code into the Components based version, thereby helping meteor developers with the upgrade path to a Components based architecture. This would mean the transpilation build step would now be turned off by the developer.
  • the components based version can also be used with Blaze under the hood so you can continue to use your Blaze-oriented packages.
  • the components based version with React as the renderer extends React.Component so that you can use either Blaze or React as the renderer without a build step. The way you do this is, for example, instead of this.state.foo you do this.state('foo'). Under the hood a reactive Tracker function is used–it must be a function after all if you are using Blaze! However, the React version calls this.state.foo within the this.state() method.

So you’d be using a slightly modified version of React, but similar enough that it’s no big deal and you know exactly what the React version of the syntax would be anyway.

All in all, the point is we have a path forward. A path from transpilation of either Blaze 1 or a Components based blaze, which we basically already have in “Blaze Components.” An official more optimized one may be better, but there isn’t too much that needs to be changed in the interface. I didn’t create Blaze Components, but I happen to have built the version I’m talkin about with what I consider is a more suitable interface. But again, it’s only small changes. So anyway you have blaze code, Blaze 1 or “Blaze Components” that can be transpiled to React in a build step. THEN, you have the option to permanently transpile your code to the Components version. That doesn’t mean you are necessarily using the React renderer yet–it can still render with Blaze just as @mitar’s Blaze Components currently does. However, this new components-based architecture also has a version of the exact same interface that simply extends React (NOT TRANSPILES!), and under the hood it calls React style code (e.g. this.state.foo instead of this.state('foo') as mentioned above.

That offers a complete upgrade path going forward, no matter which way you wanna take:

  1. USE TRANSPILE BUILD STEP TO GENEATE REACT CODE: you have old packages that
    still use Blaze 1 + your own components based on the new Components
    API, and you want it all rendered to React
  2. CONTINUE TO USE BLAZE RENDERER BUT WITH BOTH BLAZE 1 CODE + BLAZE COMPONENTS API CODE: basically you are combining old blaze code and new blaze components again like in the above point, but for whatever reason you don’t want to transpile to React. This approach will likely be phased out, but in reality will be a very helpful approach in the beginning while stabilizing the React renderer for all use cases such as Animations and the plethora of features in the React ecosystem which haven’t been made compatible yet. You have to understand that just because we have the main renderer, does not mean we have all the core React addons and essentially core features of web development working yet, again e.g. animations.
  3. PERMANENTLY TRANSPILE TO THE COMPONENTS API /W REACT RENDERER UNDER THE HOOD: so now everything you’re using is using the new
    Components API (though package code built using Blaze 1.0 will still
    work), but what you’re using under the hood is an Extension of React
    that does things like use this.state('foo') instead of
    this.state.foo or here’s another obvious example: onCreated
    really calls componentWillMount under the hood. There’s many more.
    Check the discussions in the Blaze React Github issues for more such
    discussions: https://github.com/timbrandin/blaze-react
  4. **PERMANENTLY TRANSPILE TO COMPONENTS API /W BLAZE RENDERER: so since we can transpile to a components API that is shared by both renderers, we can also transpile your blaze 1.0 code to Blaze Components. Again, it wont just happen overnight that all the core React addons behave properly. And perhaps for many Meteor packages we can never just automatically transpile them, BUT you want to start using the Blaze 2.0 Components API. Here’s the arrangement you use.

So what I’ve outlined is a path that will accomplish 2 main aims:

  • A. you can start truly taking advantage of React in a truly integrated way with Tracker/Meteor, etc, as well as a more extensible Components-based API.
  • B. you don’t have your Meteor/Blaze developers in total panic that all their code from year’s past is now obsolete and will require a major refactoring to take advantage of all new tools coming down the pipeline.

They may have a a little work going forward, but it’s a lot less work than if you force the upgrade to a renderer that only works for the new Blaze Components. And part of that is achieved by making Blaze Components work with old Blaze. If you devise a plan to share a common API, that is totally possible.

NEXT: I’d like to point out some things. The challenges people see with React coming from Blaze/Meteor land is 2.5 fold:

  1. using JSX instead of spacebars (probably the most trivial of all the problems in terms of actually solving–its not that hard to transpile Spacebars to JSX, but that barely solves the problem involving context and much more.
  2. passing functions down and then assigning them to element attributes rather than using jQuery style css selectors. This can be easily solved too. There’s no reason why now in the React community–totally unrelated to Meteor–that selectors can’t be used to select elements in child components, and in turn pass down access to the state that parent “smart components” may have. Our current jQuery style selectors interface is a good thing! Because: A) obviously code separation concerns, B) it’s already something Meteor developers understand, C) IT’S A HELL OF A LOT EASIER! This needs to be more automated in React itself. We can do first in our React.Components extension. Again, pay a visit to the Blaze React (again, previously “Sideburns”) to participate in our exploration there.

2.5. State. And I say “2.5” because the Meteor community has already been moving this direction for a while with things such as Template.instance().foo = new ReactiveVar and more recently with learning how to pass down such state unidirectionally even if seems easier at first to not have to deal with passing as many things down. There are some inherent challenges with Blaze 1.0 state because event handlers don’t have access to that state when they are triggered on an element in a child component, whereas that component may have received the state passed down as a property of that child component. Corrections need to be made to solve this. Options are: helpers exist in the context of child components, but with the state of the component where they are defined, and event handlers, which already can do that (i.e. act upon child components), maintain the original state of the component where they were defined! @mitar’s Blaze Components already goes partially the way, but not fully. Either way the result is the “smart component” “container/controller component” pattern where a component higher up the tree can manage the state of child components and without the need to pass every damn helper/event-handler down!! So anyway, this is labeled "2.5" because Meteor developers are already doing a good job wrapping their head down by the effectiveness of this pattern, but are crippled because they can’t fully actualize it in Blaze 1!.


We have a lot more to say about this one. My hope is that @gschmidt is serious about his perspective to ***“partner up and work together to make that happen”***. We at Blaze React already have something we are working towards. It’s going to happen regardless. We know you guys just got started seriously thinking about this problem. But the way Meteor usually develops is almost in Silence–a lot more than many other top Open Source projects. I love Meteor–because you run a tight shift in that way. But it can’t be denied that what’s gone on with Meteor vs. the exploding Node community at large has put it at major risk. If you guys didn’t start down this path you’re sharing today, it would basically send Meteor to an early grave. This time some things need to change, and the essence of it all is embracing the open source community more. So you can’t just build the new “ideas” anymore, but go it alone. You actually have to build them with the rest of us. In this instance, you actually have contributors already. It would be a major blunder to not take adantvantage of that. At least come chat with us IN OUR GITHUB ISSUES FORUMS before making all your decisions in private (+ a few forums.meteor.com announcements). There’s know doubt your engineering will be some of the best–there’s a lot of decisions to be made here. I have a grand vision here essentially, and I think if you hear it you will like it. I have done a lot of the work for you here already.


The final part–for now–is that React “Components” is only where the conversation should start. My vision includes Meteor becoming completely class-based. So many of our packages are procedural/imperative style coding, and as a result are not at the quality they could be. This isn’t a conversation of “Inheritance vs. Composition.” Compose all the way! But compose with “Components”–that’s why they are called “Components.” They just happen to look at lot like Classes, and in fact, in React you can use Classes.

…A side note: React is “functional” under the hood where it counts for the implementation, but “OOP” on the interface where Objects/Classes serve as a closer mirror to how Humans Think About Programming. Likely that conversation isn’t as big of a deal with MDG as it is with the hords of functional advocates who aren’t yet looking at the full picture…

So anyway, what I’m saying is publishers, subscriptions, models (most importantly), routers, etc, all should become classes. It will be that painfully obvious solution in front of our face to the supposed challenge you guys have had in leading Meteor developers to architecting extensible applications. The fact that you haven’t had that has been a major pain point for you. That said, it was absolute perfect as a “go to market” strategy to launch a more procedural/imperative approach. That time has passed now. Keep that API as your “Ruby” and now make your “Rails.” Then you won’t spend all this time writing a guide about how to cope with utilizing a sub-par system for major applications. NO offense–I’m Meteor all the way from day one. I’m just saying: as long as you’re choosing to frame this as a conversation surrounding React and not a bigger architectural OOP Class-system you’re missing the core of the problem.

So, your app shouldn’t contain a single line of code not wrapped in a class. Meteor should provide this API. It’s akin to “Rails” to “Ruby” like I just said. Now, I’m not saying it all needs to be done before the React stuff is handled–but the point is to build your new components architecture with that in mind. E.g. if you inherit, perform a mixin, whatever, in your components API it should look the same way in the soon-after-future where you will mixin to a model class that inherits from another model class. The real work won’t be in becoming OOP–that’s easy–but in making our own Relay/GraphQL style pattern for Mongo, and other such core use cases. On that note, Relay/GraphQL is great! …for the ecosystem as a whole, but (like React) is an unnecessarily complex interface for client code. In GraphQL’s case, that’s its whole purpose–to enable us developers to build adapters for our database languages. Relay seems more intent on being attached to every view Component in client code, but it too can get adapters that make it easier–easier to work with your database implementation. But perhaps all using Relay+GraphQL under the hood to take part in its ecosystem.

And also perhaps not. I think in the beginning we can build this components-attached-ORM purely for Mongo and our Components API. Down the line we can switch out direct connection to pure mongo and meteor subscriptions/publishers with a Relay/GraphQL middle layer–and not just to do it because the “cool kids are doing it,” but for practical business reasons: the growing ecosystems of these tools make a bunch more features/tasks easier and available to us. Right now that doesn’t exist with GraphQL and Relay. To take a back step and build mongo + meteor connectors to that stuff, AND THEN build our own ORM (and component methods to attach them) would be a waste of time. We should build how that interface will best look on Meteor today; and imagine how one day the middle layer could be swiped out with Relay/GraphQL, but not hold ourselves up over build it all ourselves. The point at the end of the day isn’t the tools, but the patterns:

  • data-aware container components
  • a Mongo ORM to simplify how we specify subscriptions and publishers. end of story.

Meteor needs that. Not the Relay/GraphQL rabbit hole–not yet. It solves the same problem. And again to circle back to the point i digressed from: it should be class based and share the same “Class-based Syntax as Blaze 2.0 React-interoperable Components”.

THE FUTURE I PROPOSE LOOKS LIKE THIS:

class Post extends Meteor.Model {
   fullName() {
        return ${this.firstName this.lastName};
   }
   subscriptions() {
      return {
         //description of models/collections you can describe to
      }
   }
}


class MyComponent extends Meteor.Component {
   subscriptions() {
      return {
         //configuration code related to the model subscriptions
         //you want this component automatically subscribed to
      }
   }

   onCreated() {
       this.state('foo', 'bar');
   }

   ['click .some-element']: function() {
        this.state('foo', 'bazzz');
   },

   someHelper() {
        return this._plainMethod() + ' awesome!';
   }
   _plainMethod() {
       return this.state('foo');
   }
}

So there you go that’s my proposal for what “Meteor Relay” actually looks like. Relay + GraphQL code is unnecessarily complex. React itself is unnecessarily complex. We already are seeing various tools interop and transpile to React such as Om for clojurescript or Cycle.js (which based on my research is the purest form of functional view programming in javascript, i.e. without moving to other languages such as clojurescript or elm). But anyway, as long as we are deciding to stick to the Class-based approach–whose strengths lie in its initial frictionless ease of use, natural human readability, common usage, etc–my point is take a play from their playbook: see how we don’t have to get married to the plain React interface. It’s round 1 in this functional view thing in the javascript world. The interface can be improved upon. That’s probably the most important point I’d like heard by MDG: I don’t want to see you guys go make all this stuff, but settle for a lot of React’s baggage. I predict React will win as the renderer (i.e. its “ECOSYSTEM WILL WIN”), but many facade layers on top of it (that offer better interfaces) will reign supreme. At least a lot more mixins and classes that make the methods you’re using on your React Component look almost unrecognizeable. But we can go farther than that, such as not using JSX, and still having a separate HTML-like file (which is great for designers) that uses Spacebars or an enhanced Spacebars where you can do a bit more javascript math/logic in between your curly braces. That’s still the tip of the ice berg:

  • we can use React contexts to achieve what’s already natural and more automated in Blaze: https://facebook.github.io/react/docs/context.html …See, what Blaze offers is the automation of a lot of things that you have to manually/explicitly do in React. E.g. passing down event handlers to child components to make the connection to parent state. We can automate this, while still keeping it “explicit.”
  • we can pass down a reference to a parent components, which is one of the core things we are considering at Blaze React to allow access to operators such as ../../ in Spacebars and Template.parentData(level) in template javascript code. We’ve done some initial tests and it seems to not violate any React principles in fact. Here’s what it looks like:
<MyComponent parent={this}  />

var MyComponent = React.createClass({
  parentData: function(level) {
    var parentData = this.props;
    
    for(var i = 0; i < level && parentData.parent; i++) {
      parentData = parentData.parent.props;
    }
    
    return parentData;
  },
  render: function() {
    	return <div>{this.parentData(1).count}</div>;
  }
});

http://jsfiddle.net/v755xkxx
http://jsfiddle.net/Ljpd0d0m

In short, I’d like to see a lot of work that React does automated in our React Extension. It would be a mistake to expend all this time, effort, and resources just to make our code look like React. We can do better.

Well the answer to that in its truest form–i.e. “TIGHT INTEGRATION WITH TRACKER”–involves modifying the typical React Component interface. this.state.props doesn’t cut in the Blaze of the future. What are your thoughts on that?

Would love to continue that conversation with you over here:

15 Likes

what i always liked about meteor was how templates worked with spacebars
and the we DONT mix js with HTML

if i have to use ReactDOM.render(a lot of html code) then this will be a deal breaker for me.

and whats with big apps that use blaze?
is there a plan when we will see blaze2?
what will blaze2 be like?
what is with the transition from blaze to react/angular/blaze2?
what is with loading blaze components from npm ?

and no i don’t want a answer that say you can do this with community package X
this is stuff that has to be in the core

4 Likes

that’s assuming React is the be-all and end all and we cant do better than React, itself.

3 Likes

@joshowens check my post on this thread about that:

[Next steps on Blaze and the view layer]

I have a better option, and if it truly turns out to be the right one, I trust Meteor to champion its cause. I have a feeling they are gonna like it. It basically says: “why not make everything compatiable” with a react renderer: Blaze 1, Blaze 2.0 Components, React code. Utilizing a transpilation build step, and without a transpiler once you permanently transpile all your code into components-based code (regular blaze 1.0 code would have to continue to use the transpiler build step).

I’ll tell you this much–I love “Vue.js” and the fact that MDG got that guy is a great sign…They’re just thinkin it over, Josh, if amazing options exist, I have no doubt MDG will jump on them.

2 Likes

I’m currently working on finding all the things that Blaze 1.0 can’t perfectly do if compiled to React. You are calling “Sideburns” just a “Spacebars” compiler. It is more than that. I just started looking at your blaze-react.js right now:

I think we need to collate what can’t be transpiled perfectly to React, and if it’s few enough cases, attempt to do this, and offer a suggestion list of what developers will have to manually change–perhaps even lint it with automatic suggestions.

So that means get Blaze 1.0 rendering with React first, and then move to the components based version. We’ll be able to bring everything we learned and much of the code to the components version (which will be focused around deep “Tracker Integration”). If you look in the sideburns (now called “Blaze React”) github issues you will see I’ve made headway on solving a lot of cases. I’d like to know your laundry list of “touch react” features we CAN support and of course CANT support. And then let’s work through them before we throw rendering Blaze 1.0 off the table. Doing that will be the embracing community stuff @gschmidt is indicating we are gonna see more from MDG.

ps. Love Vue.js by the way. Clean interface. You’re the perfect guy to join MDG at this time.

and I hope you guys know, that’s like the smallest part. everyone can have that today if they want it basically. quickly make a react mixin to use spacebars instead of jsx in a render method, utilizing Sideburns (now called “Blaze React”) to do so.

It would be more productive not to tout how awesome it will be to use spacebars syntax, given its a fraction of what we want. …What happened today is this:

MDG thinks you guys can pull the wool over Meteor developers’ eyes, and sooth us into all our old Blaze 1.0 code being obsolete.

That’s exactly what @gschmidt not so sutbly proposed today–though I think he thinks it was subtle. But I get it though–more research needs to be done just like he said. I trust you guys to make the best decisions once informed. You guys are not informed though, yet walk around like, for example, you have any clue about what’s going on with Sideburns, but you dont–you think it’s a spacebars template compiler. You probably haven’t even checked the repo. A lot of things are possible that you guys think are not. That’s a problem.

So what you guys indicated today is not happening, just so you know. Not on my watch. You guys can sit back and watch. I know how you guys operate–you don’t really do the community thing, @sashko just assuages us, and you decide what to do internally and go do it. I work the same way, it’s all good (though I’m working on moving to a more open approach like I hope you guys are sincere about). I’m gonna talk to Evan and I’m confident that if the case for a Blaze 1.0 react renderer is looking good he will champion it within MDG. who wouldn’t.

BLAZE 1.0 CODE WILL WORK WITH REACT
and it will open the doors to everything we desire from the React wold from there. but it has to be done first. Then we can go crazy with component architectures.

2 Likes

I dont even know why they made that decision to begin with (i.e. to have just getMeteorData()). All they had to do was track all reactive dependencies defined in component methods, and then dynamically continue to the force the component to update when they changed. “Sideways loading data” is perfectly acceptable in React. And it doesn’t just need to happen once at the first render time of that component. You can continue to force the component to update.

THAT WILL BE THE MAIN “DEEP TRACKER INTEGRATION” @evanyou @gschmidt will have to make at MDG. And that’s already stuff we are doing at “Sideburns”–now called “Blaze React.”

They should launch that for their current React integration like next week and cut all this fanfare.

I love meteor. However I feel meteor is fast becoming an erratic unstable moving target. One week you happy building your app with blaze next week you are porting every thing to a new templating language. Don’t get me wrong I’m all for the development of the meteor ecosystem but on this particular issue I strongly feel blaze should be blaze and react should be react. Spear a thought for those thousands of new comers to meteor like myself. Just when you feel you nailed something down pretty well and then suddenly the goal post is moved yet again.

Certainly one issue I have been struggling with recently with react, is the integration of certain kinds of jquery plugins. React’s diffing algorithm doesn’t play well and in many cases doesn’t play at all with certain kinds of DOM manipulation when using jQuery plugins. To fit in with the react way of doing things in many of these cases one has to re-write/ reinvent the wheel. Clearly a violation of the DRY principle and a waste of valuable development time. Surely Geoff this is not what you would want developers to spend their time doing. Blaze is a fantastic development tool, it’s accessibility and ease of use is one of the things that drew me to the community. I urge that great care be taken during this decision phase of blaze 1 or 2 because a lot of developers have spent thousands of man hours developing packages, projects etc. using blaze. If the decision is to go with blaze 2 as it has been described, the implication of course would be thousands of orphan packages. I trust that the right decision will be made for the sake of meteor’s future and the community at large. LONG LIVE BLAZE.

26 Likes

yea, forget Angular. let’s not help its growth–i mean less its any good. if its not better than React, lets not help it. We do need to embrace React though, and we should have one path going forward, with an excellent upgrade path, that ideally makes old blaze 1.0 code still compatible. that’s the holy grail. And I get the sense MDG is thinking its not when they are incorrect.

Did you guys check out Aurelia? The framework is so modular that you can swap out the databinding language syntax. Which means simply swapping out the current syntax and using Blaze syntax, even multiple language syntaxes, so the migration would be practically seamless.


The language syntax part starts at 37 minutes.

To me Angular 2 and even better Aurelia seem more logical choice. Aurelia by far, to me has the Blaze feel and I vould vote for that route.

@gschmidt
Not that my opinion here will really matter, but I really can’t resist to give a reaction. The reasons why Blaze is awesome as a solution you’ve clearly stated. I am happy that MDG is aware of this.

What I am not so happy about is how you are telling this community - including me - to migrate to React, even though many community members have offered other solutions. Well, when I am using Meteor as a tool, I wouldn’t care less. Tools can be easily exchanged for another. However, I remember something about Meteor being a platform. Platforms don’t drop support if they intend to be adopted. If the plan will be that Meteor is just a tool, fine by me.

Meteor reached 1.0 last year. Things changed a lot, underneath the hood. Good changes. I am quite happy with what Meteor offers me now. Every bit of time I invested in Meteor has been worth the while. Until recent announcements.

Basically, the statements from MDG tells me that I can’t trust your ecosystem, because in a matter of months, you will drop support or make decisions that affect my solution lifecycle. There is no consideration for people / companies who invested in training people, tooling and production applications and who now, have to invest again because these statements are crystal clear. Now from a business perspective - would it be worth investing again in a platform that will not meet business requirements?

I really don’t care which solution Meteor will add to the core. Either Vue, React, Angular or Fisherprice. In fact, if MDG proudly stands behind React as a preferred solution, no sleep lost. The more, the merrier.

However, dropping support and abandon such an important part of Meteor shows I can’t trust the lifespan of a Meteor project beyond six months. Which means I can’t trust to invest in having tailored PaaS/IaaS like Galaxy. Which means all these packages that made my life easier, require migrating too. Such, and many other announcements are hurting your business and of others - and thus your long term goals. Or, change the version of your platform to 0.x, so business owners can still consider it a project in beta.

Nothing is lost yet. I sincerely hope you understand this from a business perspective. This decision would be the anticlimax interrupting a great party.

25 Likes

I think I’ve seen the future!

It’s as confusing as the past!

Seriously, if you park all the selfish stuff to one side, there’s some great ideas from MDG and the community here about the future.

My take away from the discussion so far:

technology

  • there’s a general desire to make the next step or two backwards compatabile with Blaze (as of Meteor 1.2)
  • on the whole, for people who have thought about it from the ground up, the future is component-based
  • there is strong views on templates and code/markup seperation
  • a strong desire to retain a template-based HTML+Spacebars implementation with code/markup seperation
  • but there is an equally a strong desire to have extensible code/markup like jsx in a modular
  • Blaze React offers a solution for both
    • there’s a suggestion that both should co-exist, as the React architecture is better for reusable components and that templates are simpler for the app main layout
  • Tracker is central to the vision
  • there is some enthusiasm for the name Inferno should it come to that, possibly if iiiiiiiit is a breaking-upgrade

business/planning

  • there are open questions about how people should deploy their resources, e.g.
  • when starting new projects is Blaze a good option
  • for projects that are part way throuh, should they contine to rely on Blaze
  • there is a desire to have some sense of a timeline to help with planning

I’m happy to maintain a summary if there’s a desire for it… i’ll take suggestions and amendemnts and roll it over into a future/later posts if it becomes necessary

20 Likes

Certainly one issue I have been struggling with recently with react, is the integration of certain kinds of jquery plugins. React’s diffing algorithm doesn’t play well and in many cases doesn’t play at all with certain kinds of DOM manipulation when using jQuery plugins. To fit in with the react way of doing things in many of these cases one has to re-write/ reinvent the wheel.

True. I’ve been feeling the same pain.

If MDG does go to a React based view engine, then it really does have to play nice with the huge library of jQuery plugins that are out there… Because, as it is now, it can be pretty unpredictable as to when a jQuery plugin may cause Invariant Violations and “unexpected DOM manipulation” errors that are very hard to debug.

I think the growing library of jQuery plugins that are being ported to React is good, but the fact that it is happening at all is testament to the fact that there are some serious compatibility issues that should be considered. I doubt MDG wants Meteor to be incompatible with jQuery.

4 Likes

FINAL THOUGHT FOR: @gschmidt @evanyou @sashko

Rather than taking a Blaze 1.0 React Renderer off the table, consider the concept that such an option is only 90% possible, or even 75%–what if we build said renderer/transpiler, along with documenting global necessary Blaze 1.0 changes that must be made to fully make the upgrade/migration (and perhaps automatically indicate the precise changes specific to your project you must make via console messages from a linter).

Does said renderer have to be 100% to be a viable option? that is the question.

That said, I’m currently working out all the kinks. I’ve shared most challenges (and potential solutions) in the Sideburns repo. Events is one of the last main ones–that’s where we could end up where it will be 90% doable but require minor developer changes (here’s my exploration of that thus far: https://github.com/timbrandin/blaze-react/issues/28#issuecomment-158109576 …basically the only limitation could be that event handlers have to be defined on the component that uses it, and then developers just manually move them where they belong). I’ve discussed much of this in the previous Blaze topic on this forum. I don’t think what was expressed today would have been the same had you guys actually read that. Saying you’re going to start listening to the community more isn’t the same as having started already to listen to the community. You can lead by your actions on this one.

So, you clearly haven’t read that thread; the heart icon (i.e. a “like”) serves the purpose saying you read something by the way, that’s what it’s there for–Evan’s assigned to the job, right? Why didn’t he read it and inform Geoff before today’s somewhat decisive announcement?

At the end of the day, I just want to be able to share insights I’m providing, and know they aren’t falling on deaf ears that could otherwise have benefited from the insights. …I’ll kick off this new more open approach you guys are taking today by asking Evan:

  1. What do you think of the notion of passing references to all parent React components in order to facilitate Template.parentData(level) and the spacebars syntax ../../? http://jsfiddle.net/Ljpd0d0m/ …it works! Next question: are there cases where it doesnt??
  2. What do you think of the somewhat experimental React “Context” feature: https://facebook.github.io/react/docs/context.html …we can put that to use for a lot of things; I’m currently considering it to pass down helpers from parent component to child components the way Blaze 1.0 event handlers are passed in order to clear up some unresolved Blaze 1.0 issues with “state” in Blaze Components–the idea being that if event selectors can select child components/templates (like they already can in Blaze 1.0), then helpers have to be able to as well; both armed with the original component “state” for things to sync up.
  3. For “Deep Tracker Integration” I have an assignment for you: make React component methods automatically trigger their reactive dependencies and force updates when they change rather than have use getMeteorData (which essentially freezes the Tracker-based “reactivity” that lies at the soul of Meteor). That’s the core deep tracker integration that, in its absence, made the initial React Meteor integration launched over the summer lackluster and plain not as productive as regular blaze. It’s the crux of the backlash here and the lack of marketability behind what you currently have, all already tutorialized on the Meteor site. I suggest you take a look at this React github issue on “Sideways loading data”: https://github.com/facebook/react/issues/3398 (but I think you’re already aware of that one because it’s obviously the basis of getMeteorData; we need to embrace this and expand on it in a very “Meteor Way”).
3 Likes

Can we agree that the React architecture is better for reusable components and that templates are simpler for the app main layout? (hence the need for both)

2 Likes

Glad to see the open mind about template improvements keeping the dev experience already exists.

If it is going to have backward incompatibilities for packages using deep internals Blaze stuff, and it will have, it is inevitable… the atmospherejs.com and the package manager CLI are keys to communicate the compatibilities with the right view layer.

Discovering incompatibilities in runtime is unpleasurable.

So… after the release, could have some sort of auto-tag in atmosphere and warnings in package manager about what view layer it is compatible. This way we can balance if for some package it worth using the old Blaze 1.0 to get that great functionality. Maybe it will be possible to mix the versions using isolated components too.

If the package have upgraded to the new Blaze 2.0, a tag with which version it worked with Blaze 1.0 for easy legacy usage is a good caring too.

Congrats for the efforts and let’s keep moving. Some areas were taking too long to see baked but I believe great news are coming in 1.3 and 2.0 to keep Meteor the best alternative for the majority of modern App use cases! We have amazing talents working on.

1 Like

My 2 cents:

  1. I’m all for progress, kuddos to MDG for moving forward.

  2. Some of us have production apps so please make an upgrade ‘doable’ (Running a business/startup is stressful - as you probably know. Having the framework you rely on change under your feet adds to that. A lot.)

  3. Blaze is awesome because my designers can design their stuff without needing javascript. (Alas, often designers are not that good with code, the less they need to touch it, the better, animations and interactions is a whole other kind of designer.)

14 Likes

React only solves the View problem, and Blaze is much more than that in the Meteor ecosystem. Angular would be a more complete replacement for Blaze, but it is also a huge paradigm change from what Meteor is pushing in terms of code styling and architecture in general. Therefore, using React’s Components + Blaze seems to me like such a good solution.

5 Likes

There is other super simple library for UI, which helps to create components really hard to achieve in blaze, it is called Ractive.
Am I the only one who are using Ractive with Blaze and don’t want to touch React… ?

Has anyone tried Ractive with Meteor ?

2 Likes

I have two thoughts on this.

  1. As a front-end developer, learning Meteor was smooth and easy, largely because of blaze. It was part of the magic, part of the ‘it just works’ quality that makes meteor the ‘apple of development frameworks’, in my mind.

  2. If you can keep and improve on that magic, don’t be afraid to upset people, but only if you can really improve it. If learning Meteor will be more difficult, less smooth, or less intuitive, I’d say reconsider. Blaze is like ‘HTML+’, it makes sense, it’s readable. I haven’t used react because it looks confusing to me, although it is on my bucket-list to learn.

Conclusion: please don’t lose what made blaze incredible, but don’t be afraid to change things in order to make it more magical.

12 Likes