Announcing Blaze Components - Reusable components for Blaze

Mmmmmm, the ES6 is niiiiiiice.

Difficult to make that pull request unless you already know coffeescript…

2 Likes

Awesome work! :+1:

I prefer JS myself, so thank you for the sample code :smile:.

1 Like

Waiting for the JS version :slight_smile:

I’m not waiting. Use of CS in a package is no hindrance in my opinion. All I need to know is how to use it (with JS) in an app. @mitar has provided JS (and ES6) examples, so I’m good to go. :smile:

EDIT: I may even pick up some CS along the way :scream:

:wink:

I made a JavaScript version of the tutorial: http://components.meteor.com/

7 Likes

Very nice. Now we are talking :smile:
Good job.

1 Like

Conversion is pretty effortless. Look . . . .

CoffeeScript to JavaScript converter.

1 Like

The JS version made me curious :slight_smile: Converted one of my components to a “Blaze Component” and must say the syntax and “feel” is very nice. Could convert everything with ease. Only one thing that is unclear to me. In old blaze style, this needed all kinds of hacks, maybe these BC’s have it built in.

E.g., a dropdown is a BC. When I select an item in the dropdown, I want to dispatch an event outside to trigger something in the parent OR just want to be able to read out that selected item when I (e.g.) submit the parent. How did you envision this with BC’s? In old component style, I used the DOM root of the component, to store the selected “id” in and then read that out in the parent.

Nice one, tnx.

You can use componentParent and componentChildren methods to navigate to parents and children, and then you can call their public methods, or access their (possibly reactive) public state, like reactive vars they expose.

This is awesome. Thanks!

Because CS is awesome. Convert you heathen! :stuck_out_tongue:

Very nice docs and package!

1 Like

Apologies for adding to the hijacking of this package announcement. :flushed:

CS demonstrates what can be done to make vanilla JS fit into a more traditional OOP pattern and was likely instrumental in driving ES6. Having said that, ES6 (7 …) will become mainstream and where will that leave CS?

CS will have less of an upside than with ES5 and below, but I don’t see any downside so I don’t see why I’d need to switch “away” from CS. Not with the way CS is seamlessly integrated into Meteor and with source maps in Chrome

Wow, good work on the library, regardless of the choice of language used in the examples!

This looks really good! Definitely will give it a spin, solves some important issues!

And just so I understand: I think I have seen (somewhere…) talk about an “official” Blaze Components thing, though I may have misread. But if I haven’t, or regardless of that, is this “official” or let’s say something like a first implementation of something that is slated to become part of Meteor core? I’m new to the forums and probably wouldn’t even recognize the core devs posting etc, so that’s part of the reason that I have to ask.
Why I think I need to know this - I don’t know. It probably doesn’t really make any difference. It’s awesome that someone is doing the work (and has already done a big part of that work, as far as I can tell) of bringing a component-oriented thinking to Blaze / Helpers / Events!

I’m trying to choose which component package to use. This looks like quite good solution, but very fresh and without community yet.

@mitar could you explain a few main points why it’s better to use your blaze-components than flow-components, why you decided to create your own solution when there was already other solutions?

Awesome lib and supporting plain JS examples… You’re my hero/es!

You can see a (biased) comparison with other projects at the end of the README: https://github.com/peerlibrary/meteor-blaze-components#related-projects

I’m having a good time with Babel and ES6