Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding fuller version of a component with a flag, and alias #84

Closed
yonatanmn opened this issue Apr 8, 2015 · 1 comment
Closed

adding fuller version of a component with a flag, and alias #84

yonatanmn opened this issue Apr 8, 2015 · 1 comment

Comments

@yonatanmn
Copy link
Contributor

I'm thinking of adding an optional flag when using component generator, something like --full, that will boilerplate the most used react stages etc, that I find myself tediously writing every time.
This is even more useful when using Reflux (btw, just added a pull request with Reflux support)

It should be something like this:

'use strict';

var React = require('react/addons');
//if (architecture=== 'reflux')   
  var Reflux = require('reflux');
  //var Actions = require('actions/...');

//if (stylesLanguage === 'sass')   
 require('styles/componentName.sass');

var  componentName = React.createClass({
//if (architecture=== 'reflux')   
    mixins: [Reflux.ListenerMixin],

  getInitialState: function () {
        return {   };
   },

  componentDidMount: function () {
  },

  render: function () {
    return (
        <div>
          <p>Content for componentName </p>
        </div>
      );
  }
});

discussion

  1. I use getInitialState and componentDidMount, and reflux stuff all the time, what's yours boiler-plated code?
  2. what will be a proper name for this option (e.g --full)
  3. I think react-webpack:component is quite a lot of text. We can create an alias. like react-webpack:cmp or react-webpack:c - what do you think will be suitable? (and what about react-webpack:action and react-webpack:store?)
@weblogixx
Copy link
Member

Seems to be integrated for quite a time. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants