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

Eventually, might merge back into rails/webpacker #17

Open
justin808 opened this issue Jun 10, 2017 · 1 comment
Open

Eventually, might merge back into rails/webpacker #17

justin808 opened this issue Jun 10, 2017 · 1 comment
Labels

Comments

@justin808
Copy link
Member

I'd really appreciate feedback on rails/webpacker issue #464.

I posted this on June 4, 2017:


@gauravtiwari, in order for us to agree on the result, we have to first agree on goals.

Common Goals

React on Rails needs these 2 things:

  1. Minimal requirements put on the webpack config:
  • Creation of a manifest.json.
  • Get common Rails/Webpack configuration, like the output directory, from webpackConfigLoader (see below).
  1. stylesheet_pack_tag supports hot reloading (per prior messages).

Migration for React on Rails Apps

In order to make any migration for existing React on Rails users to use Webpacker from Webpacker Lite, I'd suggest the following are mandatory, along with the migration steps for React on Rails apps:

  1. The YAML file for configuration is SIMPLE.
  • Change the configuration file name from webpacker_lite.yml to webpacker.yml.
  • Inside the YAML config file:
    • You may remove the manifest key as the filename of the created manifest must be manifest.json
    • Change the key webpack_public_output_dir to public_output_path.
  1. Change the Gemfile to point to 'webpacker' from 'webpacker_lite'.
  2. Change the loading of the 'webpackConfigLoader' in your webpack configuration:
  • From: const webpackConfigLoader = require('react-on-rails/webpackConfigLoader');
  • To: const webpackConfigLoader = require('webpacker/webpackConfigLoader');

References from React on Rails

  1. webpackConfigLoader from React on Rails
  2. Sample Webpack config from React on Rails generator.

Action Plan

If we can agree on these, my action plan would be:

  1. Create a PR with needed changes for Webpacker, along with pushing a version beta of the gem and NPM package (maybe using some temp name).
  2. Create a PR for React on Rails that
  • Uses those the beta versions.
  • Has migration instructions and tests!
@justin808
Copy link
Member Author

Per: rails/webpacker#464 (comment)

We're ready to merge this gem back into webpacker.

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

No branches or pull requests

1 participant