react_on_rails 13.4.0 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -2
  3. data/Gemfile.development_dependencies +10 -8
  4. data/README.md +2 -2
  5. data/lib/generators/react_on_rails/base_generator.rb +10 -2
  6. data/lib/generators/react_on_rails/dev_tests_generator.rb +1 -1
  7. data/lib/generators/react_on_rails/templates/base/base/config/shakapacker.yml +1 -1
  8. data/lib/generators/react_on_rails/templates/dev_tests/spec/rails_helper.rb +2 -2
  9. data/lib/generators/react_on_rails/templates/dev_tests/spec/system/hello_world_spec.rb +1 -1
  10. data/lib/react_on_rails/configuration.rb +39 -25
  11. data/lib/react_on_rails/git_utils.rb +3 -3
  12. data/lib/react_on_rails/helper.rb +2 -2
  13. data/lib/react_on_rails/json_output.rb +0 -17
  14. data/lib/react_on_rails/locales/base.rb +4 -4
  15. data/lib/react_on_rails/locales/to_js.rb +1 -1
  16. data/lib/react_on_rails/packs_generator.rb +2 -4
  17. data/lib/react_on_rails/react_component/render_options.rb +1 -1
  18. data/lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb +9 -9
  19. data/lib/react_on_rails/test_helper/webpack_assets_status_checker.rb +3 -3
  20. data/lib/react_on_rails/test_helper.rb +2 -2
  21. data/lib/react_on_rails/utils.rb +2 -8
  22. data/lib/react_on_rails/version.rb +1 -1
  23. data/lib/react_on_rails/version_checker.rb +2 -2
  24. data/lib/react_on_rails/webpacker_utils.rb +6 -0
  25. data/lib/tasks/assets.rake +1 -1
  26. data/react_on_rails.gemspec +4 -4
  27. metadata +4 -132
  28. data/.bookignore +0 -15
  29. data/.circleci/config.yml +0 -338
  30. data/.coveralls.yml +0 -1
  31. data/.dockerignore +0 -2
  32. data/.eslintignore +0 -17
  33. data/.eslintrc +0 -53
  34. data/.github/FUNDING.yml +0 -1
  35. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -23
  36. data/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  37. data/.github/PULL_REQUEST_TEMPLATE.md +0 -19
  38. data/.github/workflows/lint-js-and-ruby.yml +0 -54
  39. data/.github/workflows/main.yml +0 -183
  40. data/.github/workflows/package-js-tests.yml +0 -35
  41. data/.github/workflows/rspec-package-specs.yml +0 -46
  42. data/.gitignore +0 -33
  43. data/.npmignore +0 -22
  44. data/.prettierignore +0 -14
  45. data/.prettierrc +0 -20
  46. data/.rspec +0 -2
  47. data/.rubocop.yml +0 -134
  48. data/.scss-lint.yml +0 -205
  49. data/.travis.yml +0 -61
  50. data/book.json +0 -18
  51. data/docs/additional-details/generator-details.md +0 -56
  52. data/docs/additional-details/manual-installation-overview.md +0 -30
  53. data/docs/additional-details/migrating-from-react-rails.md +0 -17
  54. data/docs/additional-details/recommended-project-structure.md +0 -69
  55. data/docs/additional-details/tips-for-usage-with-sp6.md +0 -15
  56. data/docs/additional-details/updating-dependencies.md +0 -31
  57. data/docs/additional-details/upgrade-webpacker-v3-to-v4.md +0 -10
  58. data/docs/api/javascript-api.md +0 -99
  59. data/docs/api/redux-store-api.md +0 -102
  60. data/docs/api/view-helpers-api.md +0 -133
  61. data/docs/contributor-info/errors-with-hooks.md +0 -45
  62. data/docs/contributor-info/generator-testing.md +0 -11
  63. data/docs/contributor-info/linters.md +0 -68
  64. data/docs/contributor-info/pull-requests.md +0 -42
  65. data/docs/contributor-info/releasing.md +0 -76
  66. data/docs/deployment/elastic-beanstalk.md +0 -63
  67. data/docs/deployment/heroku-deployment.md +0 -39
  68. data/docs/getting-started.md +0 -196
  69. data/docs/guides/client-vs-server-rendering.md +0 -27
  70. data/docs/guides/configuration.md +0 -289
  71. data/docs/guides/deployment.md +0 -5
  72. data/docs/guides/file-system-based-automated-bundle-generation.md +0 -197
  73. data/docs/guides/hmr-and-hot-reloading-with-the-webpack-dev-server.md +0 -104
  74. data/docs/guides/how-react-on-rails-works.md +0 -44
  75. data/docs/guides/how-to-conditionally-server-render-based-on-device-type.md +0 -40
  76. data/docs/guides/how-to-use-different-files-for-client-and-server-rendering.md +0 -98
  77. data/docs/guides/i18n.md +0 -87
  78. data/docs/guides/installation-into-an-existing-rails-app.md +0 -66
  79. data/docs/guides/minitest-configuration.md +0 -31
  80. data/docs/guides/rails-webpacker-react-integration-options.md +0 -213
  81. data/docs/guides/react-on-rails-overview.md +0 -29
  82. data/docs/guides/react-server-rendering.md +0 -32
  83. data/docs/guides/render-functions-and-railscontext.md +0 -205
  84. data/docs/guides/rspec-configuration.md +0 -73
  85. data/docs/guides/tutorial.md +0 -371
  86. data/docs/guides/upgrading-react-on-rails.md +0 -304
  87. data/docs/guides/webpack-configuration.md +0 -42
  88. data/docs/home.md +0 -23
  89. data/docs/javascript/angular-js-integration-migration.md +0 -28
  90. data/docs/javascript/asset-pipeline.md +0 -12
  91. data/docs/javascript/capistrano-deployment.md +0 -18
  92. data/docs/javascript/code-splitting.md +0 -165
  93. data/docs/javascript/converting-from-custom-webpack-config-to-rails-webpacker-config.md +0 -10
  94. data/docs/javascript/credits.md +0 -10
  95. data/docs/javascript/foreman-issues.md +0 -15
  96. data/docs/javascript/images.md +0 -57
  97. data/docs/javascript/node-dependencies-and-npm.md +0 -19
  98. data/docs/javascript/react-and-redux.md +0 -36
  99. data/docs/javascript/react-helmet.md +0 -100
  100. data/docs/javascript/react-router.md +0 -90
  101. data/docs/javascript/server-rendering-tips.md +0 -55
  102. data/docs/javascript/troubleshooting-when-using-shakapacker.md +0 -77
  103. data/docs/javascript/troubleshooting-when-using-webpacker.md +0 -90
  104. data/docs/javascript/webpack-v1-notes.md +0 -23
  105. data/docs/javascript/webpack.md +0 -22
  106. data/docs/misc/articles.md +0 -20
  107. data/docs/misc/code_of_conduct.md +0 -13
  108. data/docs/misc/doctrine.md +0 -77
  109. data/docs/misc/style.md +0 -33
  110. data/docs/misc/tips.md +0 -10
  111. data/docs/outdated/deferred-rendering.md +0 -39
  112. data/docs/outdated/rails-assets-relative-paths.md +0 -195
  113. data/docs/outdated/rails-assets.md +0 -77
  114. data/docs/outdated/rails3.md +0 -9
  115. data/docs/rails/convert-rails-5-api-only-app.md +0 -19
  116. data/docs/rails/rails-engine-integration.md +0 -32
  117. data/docs/rails/rails_view_rendering_from_inline_javascript.md +0 -36
  118. data/docs/rails/turbolinks.md +0 -124
  119. data/docs/react-on-rails-pro/react-on-rails-pro.md +0 -43
  120. data/docs/testimonials/hvmn.md +0 -25
  121. data/docs/testimonials/resortpass.md +0 -13
  122. data/docs/testimonials/testimonials.md +0 -28
  123. data/jest.config.js +0 -4
  124. data/package-scripts.yml +0 -49
  125. data/package.json +0 -96
  126. data/rakelib/docker.rake +0 -26
  127. data/rakelib/dummy_apps.rake +0 -30
  128. data/rakelib/example_type.rb +0 -96
  129. data/rakelib/examples.rake +0 -64
  130. data/rakelib/examples_config.yml +0 -14
  131. data/rakelib/lint.rake +0 -30
  132. data/rakelib/node_package.rake +0 -15
  133. data/rakelib/release.rake +0 -92
  134. data/rakelib/run_rspec.rake +0 -103
  135. data/rakelib/task_helpers.rb +0 -62
  136. data/script/bootstrap +0 -33
  137. data/script/release +0 -3
  138. data/script/setup +0 -23
  139. data/script/test +0 -38
  140. data/webpackConfigLoader.js +0 -71
  141. 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
@@ -1,3 +0,0 @@
1
- #!/bin/bash
2
-
3
- echo "See `rake -D release`"
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
@@ -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;