react_on_rails 13.4.0 → 14.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -2
- data/Gemfile.development_dependencies +10 -9
- data/Gemfile.lock +434 -0
- data/README.md +25 -17
- data/lib/generators/react_on_rails/base_generator.rb +3 -2
- data/lib/generators/react_on_rails/dev_tests_generator.rb +1 -1
- data/lib/generators/react_on_rails/templates/base/base/config/shakapacker.yml +1 -1
- data/lib/generators/react_on_rails/templates/dev_tests/spec/rails_helper.rb +2 -2
- data/lib/generators/react_on_rails/templates/dev_tests/spec/system/hello_world_spec.rb +1 -1
- data/lib/react_on_rails/configuration.rb +39 -25
- data/lib/react_on_rails/git_utils.rb +3 -3
- data/lib/react_on_rails/helper.rb +3 -4
- data/lib/react_on_rails/json_output.rb +0 -17
- data/lib/react_on_rails/locales/base.rb +4 -4
- data/lib/react_on_rails/locales/to_js.rb +1 -1
- data/lib/react_on_rails/packs_generator.rb +5 -6
- data/lib/react_on_rails/react_component/render_options.rb +1 -1
- data/lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb +9 -9
- data/lib/react_on_rails/test_helper/webpack_assets_status_checker.rb +3 -3
- data/lib/react_on_rails/test_helper.rb +2 -2
- data/lib/react_on_rails/utils.rb +2 -8
- data/lib/react_on_rails/version.rb +1 -1
- data/lib/react_on_rails/version_checker.rb +2 -2
- data/lib/react_on_rails/webpacker_utils.rb +6 -0
- data/lib/tasks/assets.rake +1 -1
- data/react_on_rails.gemspec +4 -4
- metadata +5 -132
- data/.bookignore +0 -15
- data/.circleci/config.yml +0 -338
- data/.coveralls.yml +0 -1
- data/.dockerignore +0 -2
- data/.eslintignore +0 -17
- data/.eslintrc +0 -53
- data/.github/FUNDING.yml +0 -1
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -23
- data/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -19
- data/.github/workflows/lint-js-and-ruby.yml +0 -54
- data/.github/workflows/main.yml +0 -183
- data/.github/workflows/package-js-tests.yml +0 -35
- data/.github/workflows/rspec-package-specs.yml +0 -46
- data/.gitignore +0 -33
- data/.npmignore +0 -22
- data/.prettierignore +0 -14
- data/.prettierrc +0 -20
- data/.rspec +0 -2
- data/.rubocop.yml +0 -134
- data/.scss-lint.yml +0 -205
- data/.travis.yml +0 -61
- data/book.json +0 -18
- data/docs/additional-details/generator-details.md +0 -56
- data/docs/additional-details/manual-installation-overview.md +0 -30
- data/docs/additional-details/migrating-from-react-rails.md +0 -17
- data/docs/additional-details/recommended-project-structure.md +0 -69
- data/docs/additional-details/tips-for-usage-with-sp6.md +0 -15
- data/docs/additional-details/updating-dependencies.md +0 -31
- data/docs/additional-details/upgrade-webpacker-v3-to-v4.md +0 -10
- data/docs/api/javascript-api.md +0 -99
- data/docs/api/redux-store-api.md +0 -102
- data/docs/api/view-helpers-api.md +0 -133
- data/docs/contributor-info/errors-with-hooks.md +0 -45
- data/docs/contributor-info/generator-testing.md +0 -11
- data/docs/contributor-info/linters.md +0 -68
- data/docs/contributor-info/pull-requests.md +0 -42
- data/docs/contributor-info/releasing.md +0 -76
- data/docs/deployment/elastic-beanstalk.md +0 -63
- data/docs/deployment/heroku-deployment.md +0 -39
- data/docs/getting-started.md +0 -196
- data/docs/guides/client-vs-server-rendering.md +0 -27
- data/docs/guides/configuration.md +0 -289
- data/docs/guides/deployment.md +0 -5
- data/docs/guides/file-system-based-automated-bundle-generation.md +0 -197
- data/docs/guides/hmr-and-hot-reloading-with-the-webpack-dev-server.md +0 -104
- data/docs/guides/how-react-on-rails-works.md +0 -44
- data/docs/guides/how-to-conditionally-server-render-based-on-device-type.md +0 -40
- data/docs/guides/how-to-use-different-files-for-client-and-server-rendering.md +0 -98
- data/docs/guides/i18n.md +0 -87
- data/docs/guides/installation-into-an-existing-rails-app.md +0 -66
- data/docs/guides/minitest-configuration.md +0 -31
- data/docs/guides/rails-webpacker-react-integration-options.md +0 -213
- data/docs/guides/react-on-rails-overview.md +0 -29
- data/docs/guides/react-server-rendering.md +0 -32
- data/docs/guides/render-functions-and-railscontext.md +0 -205
- data/docs/guides/rspec-configuration.md +0 -73
- data/docs/guides/tutorial.md +0 -371
- data/docs/guides/upgrading-react-on-rails.md +0 -304
- data/docs/guides/webpack-configuration.md +0 -42
- data/docs/home.md +0 -23
- data/docs/javascript/angular-js-integration-migration.md +0 -28
- data/docs/javascript/asset-pipeline.md +0 -12
- data/docs/javascript/capistrano-deployment.md +0 -18
- data/docs/javascript/code-splitting.md +0 -165
- data/docs/javascript/converting-from-custom-webpack-config-to-rails-webpacker-config.md +0 -10
- data/docs/javascript/credits.md +0 -10
- data/docs/javascript/foreman-issues.md +0 -15
- data/docs/javascript/images.md +0 -57
- data/docs/javascript/node-dependencies-and-npm.md +0 -19
- data/docs/javascript/react-and-redux.md +0 -36
- data/docs/javascript/react-helmet.md +0 -100
- data/docs/javascript/react-router.md +0 -90
- data/docs/javascript/server-rendering-tips.md +0 -55
- data/docs/javascript/troubleshooting-when-using-shakapacker.md +0 -77
- data/docs/javascript/troubleshooting-when-using-webpacker.md +0 -90
- data/docs/javascript/webpack-v1-notes.md +0 -23
- data/docs/javascript/webpack.md +0 -22
- data/docs/misc/articles.md +0 -20
- data/docs/misc/code_of_conduct.md +0 -13
- data/docs/misc/doctrine.md +0 -77
- data/docs/misc/style.md +0 -33
- data/docs/misc/tips.md +0 -10
- data/docs/outdated/deferred-rendering.md +0 -39
- data/docs/outdated/rails-assets-relative-paths.md +0 -195
- data/docs/outdated/rails-assets.md +0 -77
- data/docs/outdated/rails3.md +0 -9
- data/docs/rails/convert-rails-5-api-only-app.md +0 -19
- data/docs/rails/rails-engine-integration.md +0 -32
- data/docs/rails/rails_view_rendering_from_inline_javascript.md +0 -36
- data/docs/rails/turbolinks.md +0 -124
- data/docs/react-on-rails-pro/react-on-rails-pro.md +0 -43
- data/docs/testimonials/hvmn.md +0 -25
- data/docs/testimonials/resortpass.md +0 -13
- data/docs/testimonials/testimonials.md +0 -28
- data/jest.config.js +0 -4
- data/package-scripts.yml +0 -49
- data/package.json +0 -96
- data/rakelib/docker.rake +0 -26
- data/rakelib/dummy_apps.rake +0 -30
- data/rakelib/example_type.rb +0 -96
- data/rakelib/examples.rake +0 -64
- data/rakelib/examples_config.yml +0 -14
- data/rakelib/lint.rake +0 -30
- data/rakelib/node_package.rake +0 -15
- data/rakelib/release.rake +0 -92
- data/rakelib/run_rspec.rake +0 -103
- data/rakelib/task_helpers.rb +0 -62
- data/script/bootstrap +0 -33
- data/script/release +0 -3
- data/script/setup +0 -23
- data/script/test +0 -38
- data/webpackConfigLoader.js +0 -71
- data/yarn.lock +0 -7010
data/script/bootstrap
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
|
3
|
-
# script/bootstrap: Resolve all dependencies that the application requires to
|
4
|
-
# run.
|
5
|
-
|
6
|
-
set -e
|
7
|
-
|
8
|
-
cd "$(dirname "$0")/.."
|
9
|
-
|
10
|
-
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
|
11
|
-
brew update
|
12
|
-
|
13
|
-
brew bundle check 2>&1 >/dev/null || {
|
14
|
-
echo "==> Installing Homebrew dependencies…"
|
15
|
-
brew bundle
|
16
|
-
}
|
17
|
-
fi
|
18
|
-
|
19
|
-
if [ -f ".ruby-version" ] && [ -z "$(rbenv version-name 2>/dev/null)" ]; then
|
20
|
-
echo "==> Installing Ruby…"
|
21
|
-
rbenv install --skip-existing
|
22
|
-
which bundle 2>&1 >/dev/null || {
|
23
|
-
gem install bundler
|
24
|
-
rbenv rehash
|
25
|
-
}
|
26
|
-
fi
|
27
|
-
|
28
|
-
if [ -f "Gemfile" ]; then
|
29
|
-
echo "==> Installing gem dependencies…"
|
30
|
-
bundle check --path vendor/gems 2>&1 >/dev/null || {
|
31
|
-
bundle install --path vendor/gems --quiet --without production
|
32
|
-
}
|
33
|
-
fi
|
data/script/release
DELETED
data/script/setup
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
|
3
|
-
# script/setup: Set up application for the first time after cloning, or set it
|
4
|
-
# back to the initial first unused state.
|
5
|
-
|
6
|
-
set -e
|
7
|
-
|
8
|
-
cd "$(dirname "$0")/.."
|
9
|
-
|
10
|
-
script/bootstrap
|
11
|
-
|
12
|
-
echo "===> Setting up DB..."
|
13
|
-
# reset database to a fresh state.
|
14
|
-
bin/rake db:create db:reset
|
15
|
-
|
16
|
-
if [ -z "$RAILS_ENV" ] && [ -z "$RACK_ENV" ]; then
|
17
|
-
# Only things for a development environment will run inside here
|
18
|
-
# Do things that need to be done to the application to set up for the first
|
19
|
-
# time. Or things needed to be run to to reset the application back to first
|
20
|
-
# use experience. These things are scoped to the application's domain.
|
21
|
-
fi
|
22
|
-
|
23
|
-
echo "==> App is now ready to go!"
|
data/script/test
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
|
3
|
-
# script/test: Run test suite for application. Optionally pass in a path to an
|
4
|
-
# individual test file to run a single test.
|
5
|
-
|
6
|
-
|
7
|
-
set -e
|
8
|
-
|
9
|
-
cd "$(dirname "$0")/.."
|
10
|
-
|
11
|
-
[ -z "$DEBUG" ] || set -x
|
12
|
-
|
13
|
-
export RACK_ROOT=$(cd "$(dirname $0)"/.. && pwd)
|
14
|
-
|
15
|
-
if [ "$RAILS_ENV" = "test" ] || [ "$RACK_ENV" = "test" ]; then
|
16
|
-
# if executed and the environment is already set to `test`, then we want a
|
17
|
-
# clean from scratch application. This almost always means a ci environment,
|
18
|
-
# since we set the environment to `test` directly in `script/cibuild`.
|
19
|
-
script/setup
|
20
|
-
else
|
21
|
-
# if the environment isn't set to `test`, set it to `test` and update the
|
22
|
-
# application to ensure all dependencies are met as well as any other things
|
23
|
-
# that need to be up to date, like db migrations. The environement not having
|
24
|
-
# already been set to `test` almost always means this is being called on it's
|
25
|
-
# own from a `development` environment.
|
26
|
-
export RAILS_ENV="test" RACK_ENV="test"
|
27
|
-
|
28
|
-
script/update
|
29
|
-
fi
|
30
|
-
|
31
|
-
echo "===> Running tests..."
|
32
|
-
|
33
|
-
if [ -n "$1" ]; then
|
34
|
-
# pass arguments to test call. This is useful for calling a single test.
|
35
|
-
bin/rake test "$1"
|
36
|
-
else
|
37
|
-
bin/rake test
|
38
|
-
fi
|
data/webpackConfigLoader.js
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* TODO: THIS SHOULD BE REMOVED
|
3
|
-
*
|
4
|
-
* Allow defaults for the config/webpacker.yml. Thee values in this file MUST match values
|
5
|
-
* in https://github.com/rails/webpacker/blob/master/lib/install/config/webpacker.yml
|
6
|
-
*
|
7
|
-
* NOTE: for HMR reloading, env.WEBPACKER_HMR value will override any config value. This env value
|
8
|
-
* should be set to TRUE to turn this on.
|
9
|
-
*/
|
10
|
-
|
11
|
-
const { join, resolve } = require('path');
|
12
|
-
const { env } = require('process');
|
13
|
-
const { safeLoad } = require('js-yaml');
|
14
|
-
const { readFileSync } = require('fs');
|
15
|
-
|
16
|
-
function removeOuterSlashes(string) {
|
17
|
-
return string.replace(/^\/*/, '').replace(/\/*$/, '');
|
18
|
-
}
|
19
|
-
|
20
|
-
function formatPublicPath(settings) {
|
21
|
-
if (settings.dev_server) {
|
22
|
-
const { host } = settings.dev_server;
|
23
|
-
const { port } = settings.dev_server;
|
24
|
-
const path = settings.public_output_path;
|
25
|
-
const hostWithHttp = `http://${host}:${port}`;
|
26
|
-
|
27
|
-
let formattedHost = removeOuterSlashes(hostWithHttp);
|
28
|
-
if (formattedHost && !/^http/i.test(formattedHost)) {
|
29
|
-
formattedHost = `//${formattedHost}`;
|
30
|
-
}
|
31
|
-
const formattedPath = removeOuterSlashes(path);
|
32
|
-
return `${formattedHost}/${formattedPath}/`;
|
33
|
-
}
|
34
|
-
|
35
|
-
const publicOuterPathWithoutOutsideSlashes = removeOuterSlashes(settings.public_output_path);
|
36
|
-
return `//${publicOuterPathWithoutOutsideSlashes}/`;
|
37
|
-
}
|
38
|
-
|
39
|
-
/**
|
40
|
-
* @param configPath, location where webpacker.yml will be found
|
41
|
-
* Return values are consistent with Webpacker's js helpers
|
42
|
-
* For example, you might define:
|
43
|
-
* const isHMR = settings.dev_server && settings.dev_server.hmr
|
44
|
-
* @returns {{
|
45
|
-
settings,
|
46
|
-
resolvedModules,
|
47
|
-
output: { path, publicPath, publicPathWithHost }
|
48
|
-
}}
|
49
|
-
*/
|
50
|
-
const configLoader = (configPath) => {
|
51
|
-
// Some test environments might not have the NODE_ENV set, so we'll have fallbacks.
|
52
|
-
const configEnv = env.NODE_ENV || env.RAILS_ENV || 'development';
|
53
|
-
const ymlConfigPath = join(configPath, 'webpacker.yml');
|
54
|
-
const settings = safeLoad(readFileSync(ymlConfigPath, 'utf8'))[configEnv];
|
55
|
-
|
56
|
-
// NOTE: Rails path is hard coded to `/public`
|
57
|
-
const output = {
|
58
|
-
// Next line differs from the webpacker definition as we use the configPath to create
|
59
|
-
// the relative path.
|
60
|
-
path: resolve(configPath, '..', 'public', settings.public_output_path),
|
61
|
-
publicPath: `/${settings.public_output_path}/`.replace(/([^:]\/)\/+/g, '$1'),
|
62
|
-
publicPathWithHost: formatPublicPath(settings),
|
63
|
-
};
|
64
|
-
|
65
|
-
return {
|
66
|
-
settings,
|
67
|
-
output,
|
68
|
-
};
|
69
|
-
};
|
70
|
-
|
71
|
-
module.exports = configLoader;
|