by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 04 16:31
    grmlin commented #384
  • May 04 16:09
    taion commented #384
  • May 04 06:48
    SimonErich opened #384
  • Oct 31 2018 22:23
    martyhu closed #28
  • Sep 20 2016 03:30
    geoffharcourt closed #202
  • Apr 12 2016 12:57
    quazzie closed #354
  • Apr 12 2016 12:56
    quazzie closed #280
  • Feb 12 2016 22:26
    taion closed #3
  • Feb 12 2016 22:26
    taion commented #3
  • Feb 12 2016 22:26

    taion on drop-rn-dep

    (compare)

  • Feb 12 2016 22:26

    taion on master

    Use React directly Merge pull request #4 from mart… (compare)

  • Feb 12 2016 22:26
    taion closed #4
  • Feb 12 2016 22:26
    chirag04 commented #4
  • Feb 12 2016 22:25
    taion commented #3
  • Feb 12 2016 22:24
    taion opened #4
  • Feb 12 2016 22:24

    taion on drop-rn-dep

    Use React directly (compare)

  • Feb 12 2016 22:19
    chirag04 commented #3
  • Feb 12 2016 21:44
    taion commented #3
  • Feb 12 2016 21:44
    taion commented #3
  • Feb 12 2016 21:28
    chirag04 opened #3
Anthony Smith
@anthonator
Anybody using Marty v0.10 and React Router v1.0.0 beta?
Jimmy Jia
@taion
not yet, waiting for the API for RR v1 to stabilize
Simon Auer
@SimonErich
@taion do you know or have a good webpack boilerplate that works with isomorphic applications?
Jimmy Jia
@taion
for marty? not to my knowledge
Jonathan Araquistain
@jaraquistain

@SimonErich I'm using Marty with an isomorphic app. Here's my gulp task and Webpack config. It can probably be better (anyone who has suggestions please feel free to comment) but it works.

Gulp task

/**
 * WEBPACK
 * This task compiles all the source JS into a single file. See ./webpack.config.js
 * for differences between DEV and PROD builds
 */
var webpackConfig = require("./webpack.config.js");
var devCompiler = webpack(webpackConfig.dev);
var prodCompiler = webpack(webpackConfig.prod);

var handleWebpack = function handleWebpack(build, callback, err, stats) {
    if (err) { throw new gutil.PluginError("webpack:dev", err); }

    gutil.log("[" + build + "]", "\n" + stats.toString({
            colors: true,
            chunkModules: false
        }));

    callback();
};

gulp.task("webpack:dev", ["clean:js:dev"], function (callback) {
    devCompiler.run(handleWebpack.bind(this, "webpack:dev", callback));
});

gulp.task("webpack:prod", ["clean:js:prod"], function (callback) {
    prodCompiler.run(handleWebpack.bind(this, "webpack:prod", callback));
});

wepack.config.js

/*eslint-disable*/
var webpack = require("webpack");
var assign = require("object-assign");
var config = {};


//Config options shared across DEV and PROD
var base = {
    entry: "./app/client.js",
    module: {
        loaders: [
            {test: /\.(js|jsx)$/, exclude: /node_modules/, loader: require.resolve("babel-loader")}
        ]
    }
};

//DEV specific config options
config.dev = assign({}, base, {
    output: {
        path: "./build/development/js",
        filename: "client.js"
    },
    plugins: [
        //This bit makes sure that any dependency that relies on React or React/Addons all use a single instance
        new webpack.NormalModuleReplacementPlugin(/^react?$/, require.resolve("react")),
        new webpack.NormalModuleReplacementPlugin(/^react(\/addons)?$/, require.resolve("react/addons"))
    ],
    debug: true,
    devtool: "eval"
});

//PROD specific config options
config.prod = assign({}, base, {
    output: {
        path: "./build/production/js",
        filename: "client.js"
    },
    plugins: [
        //This bit makes sure that any dependency that relies on React or React/Addons all use a single instance
        new webpack.NormalModuleReplacementPlugin(/^react?$/, require.resolve("react")),
        new webpack.NormalModuleReplacementPlugin(/^react(\/addons)?$/, require.resolve("react/addons")),
        //Sets the NODE_ENV to production within the webpack build
        new webpack.DefinePlugin({
            "process.env": {
                "NODE_ENV": JSON.stringify("production")
            }
        }),
        //Minify
        new webpack.optimize.OccurenceOrderPlugin(true),
        new webpack.optimize.DedupePlugin(),
        new webpack.optimize.UglifyJsPlugin()
    ],
    devtool: "source-map"
});

module.exports = config;
Simon Auer
@SimonErich
@jaraquistain thank you so much. This is awesome. I will try to read into it and build something up.
I think it would be really good to have a boilerplate for marty. I started using it with marty v0.8 and the yo generator was working back then for beginners to get into it, but I just used the generator and it seems it hasn't been updated to v10.0.
To be honest I would probably not have started to use and love marty without that.
Joey
@Twister915
I'm terribly confused. Do I need to add an express route for each of the routes I also want to define for the yeoman marty generator project?
John Arnold
@Surreal9
anyone start making the move to Alt or Redux?
Jinyue Xia
@jyxia
Hi everyone, I have a question using Marty or Flux maybe. Suppose I have one Marty query for one API call, and there are two stores using this API query. Each store has it's handler listening the response from this query. So my question is how to have the query know which store it should send the response (dispatch an action to a specific store)? I don't want two dispatches happen at the same time in the promise because there may be one store did not make this API call at all.
John Arnold
@Surreal9
you could always pass along some flag and then dispatch different actions based on that
Jinyue Xia
@jyxia
Ok, I thought about that. I just don't know it is a good way to do that or not.
Thanks @Surreal9
By the way how to join the slack channel? Do I need to get invited?
John Arnold
@Surreal9
oh, didn't know there was a slack channel.. thought this was the main chat
Jinyue Xia
@jyxia
:smile:
John Arnold
@Surreal9
perhaps just google reactiflux and go from there
I see a mention of it from @taion who has been pretty active with marty
and have checked it out since it's linked to the #reactjs irc on freenode
Jinyue Xia
@jyxia
https://reactiflux.slack.com/messages/marty/ this is the slack channel, because I am not in the group, I could not sign in
John Arnold
@Surreal9
ah
Jonathan Araquistain
@jaraquistain
@Surreal9 I'm curious about people migrating too. I've got a big release in a couple months and I think Marty will do just fine for that but come October or so I'm going to actively try to migrate to Redux. By then 1.0 will be out and the docs will be more robust I'm sure
John Arnold
@Surreal9
yeah exactly, I'm in the same boat.. release coming soon, will just move ahead with Marty and then look at moving after.. just not sure what to go to. hearing good things about both Alt and Redux..
but also reading about how people are moving state out of stores and all sorts of crazy things.. kinda interesting
Jonathan Araquistain
@jaraquistain
In general I prefer functional programming patterns (and so does my company) so that's the major reason for me to go with Redux. I think the only thing that would probably change my mind is if migration from Marty to Alt is painless and I don't have the resources to spend a ton of time migrating to Redux.
Jimmy Jia
@taion
you can sign up for reactiflux here: http://www.reactiflux.com/
the migration path is different
assuming relay doesn't make the whole point moot, i will be setting up marty -> alt migration stuff
if you're using core flux features like actions/stores, then it doesn't make much of a difference either way
if you're using e.g. Store#fetch and Application#render, then you'll have an easier time migrating to alt
because alt has equivalent features to those while they're out-of-scope for redux
Jimmy Jia
@taion
the other consideration is that FB devs are targeting local stage management for relay as well
so this might just be a moot point
Tony Grebnev
@tonypizzicato
Hello guys, i have a question about container and it component. How can i handle props change in a component on store change? When componentWillReceiveProps is called, this.props already equal to nextProps argument, so i can't check the difference between store states
John Arnold
@Surreal9
are you sure it's equal? like you're using immutable objects, or you are doing a deep compare?
Jimmy Jia
@taion
sounds like it might just be a consequence of using mutable objects and mutating rather than replacing
Tony Grebnev
@tonypizzicato
sounds like this could be a problem, thnx
Jimmy Jia
@taion
༼ つ ◕◡◕ ༽つ Got RELAY
John Arnold
@Surreal9
Anyone ported over to Redux, and care to comment on their experience?
Jonathan Araquistain
@jaraquistain
^I'd be curious to hear about anyone's experiences too. Thinking about taking the plunge after our next major release.
Jimmy Jia
@taion
i'd consider relay, fwiw
depending on how much local state you have to deal with
it's sort of just a more full solution to the problems you use flux to address
John Arnold
@Surreal9
Relay instead of flux?
Jimmy Jia
@taion
yes
John Arnold
@Surreal9
Although I've heard of Relay I haven't really looked into it much.. have you used it yet?
Jimmy Jia
@taion
yes
it's amazing
Punita Ojha
@punitaojha
This message was deleted
Lioxor64
@lioxor64

Hello, my name is Liora and I am currently hunting open source projects for company NeuraLegion (www.neuralegion.com)
We just launched a free annual subscription for open source projects for our AIAST tool NexPloit.

If you are interested, please, reach us on opensource@neuralegion.com!

Thank you for your time and consideration! If you have any questions, please do not hesitate to contact us!

Best,