Announcing Blaze Components - Reusable components for Blaze


#1

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:


Patterns and practices for passing data between templates
Proposal for Blaze 2
#2

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


#3

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


#4

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:


#5

really :smile:


#6

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


#7

I made an example in JavaScript and ES6:


#8

Mmmmmm, the ES6 is niiiiiiice.


#9

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


#10

Awesome work! :+1:

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


#11

Waiting for the JS version :slight_smile:


#12

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:


#13

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


#14

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


#15

Conversion is pretty effortless. Look . . . .

CoffeeScript to JavaScript converter.


#16

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.


#17

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.


#18

This is awesome. Thanks!


#19

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

Very nice docs and package!


#20

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?