Announcing Blaze Components - Reusable components for Blaze

Just released: https://github.com/peerlibrary/meteor-blaze-components

Blaze Components for Meteor are a system for easily developing complex UI elements that need to be reused around your Meteor app.

See live tutorial here: http://components.meteor.com/

Feedback welcome. :slight_smile:

19 Likes

Any chance of a rewrite of the guide and example page in JavaScript instead of CoffeeScript?..

14 Likes

^^ I second that. Seems like CoffeeScript is the de-facto favorite for Meteor and I can’t understand why.

7 Likes

Because CoffeeScript really makes OOP easy in JavaScript?

Anyway, one can make a pull request to the tutorial app which switches between implementations. :slight_smile:

3 Likes

really :smile: …

2 Likes

It’s a great idea! . It’s nice to see an OOP way of doing things.

I made an example in JavaScript and ES6:

5 Likes

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?