Skip to content

How do you manage dependencies? #135

@krashidov

Description

@krashidov

Hello everyone,

I wanted to create a Rails app with React, following this tutorial:
https://medium.com/@olance/rails-react-browserify-e315001d5974

The summary of that tutorial is that he shows how to setup the react-rails gem and add browserify so that you can manage your dependencies using npm and load them with commonJS.

But, reading from the issues, it looks like commonjs and broweserify is not supported with this gem, (unless you use a workaround like #120 )

So my question is, what is the preferred or "first-class" way of handling dependencies ?

Thanks in advance!

Activity

rmosolgo

rmosolgo commented on Dec 23, 2014

@rmosolgo
Member

I think the short answer is:

  • This gem works great if you do your dependencies Sprockets-style (eg, installing gems like underscore-rails or copy-pasting dependencies into app/assets/javascripts/vendor, then requiring them with //= require ....)
  • This gem doesn't have any trappings to support commonjs requires, and that's a known bummer. No PRs to fix it at the moment, just some suggested workarounds :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @krashidov@rmosolgo

        Issue actions

          How do you manage dependencies? · Issue #135 · reactjs/react-rails