Comments (3)
No, mixins in Blaze Components were designed to work well with ES6 and JavaScript. As described in the README:
JavaScript is a single-inheritance language and instead of Blaze Components trying to force fake multiple-inheritance onto a language, it offers a set of utility methods which allow the component to interact with its mixins and mixins with the component. The code becomes more verbose because of the use of methods instead of overloading, overriding or extending the existing elements of the language or objects, but we believe that results are easier to read, understand, and maintain.
We decide to simply use a system on top of what JavaScript provides, without any mingling of JavaScript internals. See the diagram in the README.
Also, it is an optional feature. You do not have to use mixins. You can vanilla JavaScript or ES6. If that is good enough for you, great. If not, Blaze Components offer a non-intrusive API to provide mixins for you. It is mostly there so that if community develops mixins that those mixins can interoperate, instead of each implementing some fake ways manually.
So mixins as they are in Blaze Components are "real in ES6". They work with ES6. Maybe they should be named something else, just to not confuse things when there will be official mixin support in ES2099. But what is here is now and working, and behaves as a mixin. If there will be some mixins in the future, they will be not conflicting with these mixins (except in the name).
Also, mixins are not the core reason this package exist. This package exist mostly to make UI in Meteor more reusable. If there will be other mixins available, then that will be just another way to provide more composability. And we can always then just make internal implementation of Blaze Components mixins use official mixins.
I also talked with Dave Herman about ES6 and mixins do not seem to be anywhere near. So I do not think we should worry about this now. And in meantime we can use these non-intrusive mixins. :-)
from meteor-blaze-components.
So mixins are offered now because nothing better exists. But you can decide not to use them and use only inheritance. I think that for UI composability is better, but we will see how things will go. This is the idea of the project. To create a community developing reusable components. And we will all learn what works and what does not. How you compose or inherit event handlers? How you compose or inherit animations? How you compose or inherit template content? Still many open questions. But at least now we have a space around which we can start trying things out.
from meteor-blaze-components.
(Closing as answered, but discussion can continue.)
from meteor-blaze-components.
Related Issues (20)
- Example of mixin for two-way binding HOT 3
- TemplateTwoWayBinding HOT 3
- Template2
- How do you guys do Modals? HOT 8
- [Question] Best way to create a documentation about components HOT 23
- Ideas for new features of Blaze Components HOT 9
- [Question] Migrating to Blaze once the npm version is released. HOT 1
- Write template HTML within component JS? HOT 2
- How to unit-test a component? Guidance needed HOT 5
- Values is not defined HOT 2
- General Question HOT 1
- Interfacing with react.js HOT 6
- In-line component creation for lack of method params HOT 3
- What projects besides weekan are built with this library HOT 3
- Performance HOT 1
- Template Strings ? HOT 1
- Support coffeescript 2 (in Meteor 1.6.1) HOT 8
- Migrating to react: Rendering of BlazeComponents via React is NOT possible HOT 2
- error updating to Blaze Components 0.23 & Meteor 1.8.2-rc.3 HOT 3
- Meteor 1.8.2: ReferenceError: meteorBabelHelpers is not defined HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-blaze-components.