Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/markdown-link-check-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"ignorePatterns": [
{
"pattern": "^http://localhost"
},
{
"pattern": "^https://localhost"
},
{
"pattern": "^mailto:"
}
],
"replacementPatterns": [
{
"pattern": "^/",
"replacement": "https://github.com/shakacode/react_on_rails/blob/master/"
}
],
"httpHeaders": [
{
"urls": ["https://docs.github.com", "https://github.com"],
"headers": {
"Accept": "text/html"
}
}
],
"timeout": "20s",
"retryOn429": true,
"retryCount": 3,
"fallbackRetryDelay": "30s",
"aliveStatusCodes": [200, 206]
}
34 changes: 34 additions & 0 deletions .github/workflows/check-markdown-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check Markdown Links

on:
push:
branches: [master]
paths:
- '**.md'
- '.github/workflows/check-markdown-links.yml'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The config file .github/markdown-link-check-config.json should be included as well, since changing it can affect whether the check passes. I initially thought this file shouldn't be included, but the options starting on line 26 do matter.

pull_request:
paths:
- '**.md'
- '.github/workflows/check-markdown-links.yml'
schedule:
# Run weekly on Monday at 8am UTC
- cron: '0 8 * * 1'
workflow_dispatch:

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Check markdown links
uses: gaurav-nelson/github-action-markdown-link-check@v1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@alexeyr-ci2 alexeyr-ci2 Sep 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separately from the above, consider pinning to the exact SHA, even if the current workflows don't do that yet https://www.stepsecurity.io/blog/pinning-github-actions-for-enhanced-security-a-complete-guide

This is a much less used action than e.g. checkout, so less likely to be a target, but if it is compromised, less likely to be noticed as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this one? It's deprecated and recommends either https://github.com/tcort/github-action-markdown-link-check or https://github.com/UmbrellaDocs/action-linkspector instead.

Should we consider lychee-action instead? It's more actively maintained and Rust-based. Investigated the config migration:

  • Keeps: timeout, retries, headers, status codes
  • Loses: replacementPatterns - but we have zero / links in docs, so it's dead config
  • Gains: caching, better performance

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your choice, but looks good.

with:
use-quiet-mode: 'yes'
use-verbose-mode: 'no'
config-file: '.github/markdown-link-check-config.json'
folder-path: 'docs/'
file-extension: '.md'
max-depth: -1
check-modified-files-only: 'no'
base-branch: 'master'
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
react_on_rails (16.0.1.rc.0)
react_on_rails (16.0.1.rc.2)
addressable
connection_pool
execjs (~> 2.5)
Expand Down
2 changes: 1 addition & 1 deletion docs/additional-details/manual-installation-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The only requirements within this directory for basic React on Rails integration
1. Your Webpack configuration files:
1. Create outputs in a directory like `/public/webpack`, which is customizable in your `config/initializers/react_on_rails.rb`.
1. Provide server rendering if you wish to use that feature.
1. Your JavaScript code "registers" any components and stores per the ReactOnRails APIs of ReactOnRails.register(components) and ReactOnRails.registerStore(stores). See [our JavaScript API docs](../api/javascript-api.md) and the [React on Rails source](https://github.com/shakacode/react_on_rails/tree/master/node_package/src/ReactOnRails.client.js).
1. Your JavaScript code "registers" any components and stores per the ReactOnRails APIs of ReactOnRails.register(components) and ReactOnRails.registerStore(stores). See [our JavaScript API docs](../api/javascript-api.md) and the [React on Rails source](https://github.com/shakacode/react_on_rails/tree/master/node_package/src/ReactOnRails.client.ts).
1. Set your registration file as an "entry" point in your Webpack configs.
1. Configure scripts in `client/package.json` as shown in the example apps. These are used for building your Webpack assets. Also do this for your top-level `package.json`.

Expand Down
6 changes: 3 additions & 3 deletions docs/additional-details/upgrade-webpacker-v3-to-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The following steps can be followed to update a Webpacker v3.5 app to v4.

1. Update the gem `webpacker` and the package `@rails/webpacker`
1. Merge changes from the new default [.babelrc](https://github.com/shakacode/react_on_rails/tree/master/lib/install/config/.babelrc) to your `/.babelrc`. If you are using React, you need to add `"@babel/preset-react"`, to the list of `presets`.
1. Copy the file [.browserslistrc](https://github.com/shakacode/react_on_rails/tree/master/lib/install/config/.browserslistrc) to `/`.
1. Merge any differences between [config/webpacker.yml](https://github.com/shakacode/react_on_rails/tree/master/lib/install/config/webpacker.yml) and your `/config/webpacker.yml`.
1. Merge changes from the new default [babel.config.js](https://github.com/shakacode/react_on_rails/tree/master/lib/generators/react_on_rails/templates/base/base/babel.config.js.tt) to your `/babel.config.js`. If you are using React, you need to add `"@babel/preset-react"`, to the list of `presets`.
1. Copy the file [shakapacker.yml](https://github.com/shakacode/react_on_rails/tree/master/lib/generators/react_on_rails/templates/base/base/config/shakapacker.yml) to `/config/` (Note: newer versions use Shakapacker instead of Webpacker).
1. Check generator templates in [lib/generators/react_on_rails/templates](https://github.com/shakacode/react_on_rails/tree/master/lib/generators/react_on_rails/templates) for current configuration files.

Here is an [example commit of these changes](https://github.com/shakacode/react_on_rails-tutorial-v11/pull/1/files).
2 changes: 1 addition & 1 deletion docs/api/view-helpers-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Renderer functions are not meant to be used on the server since there's no DOM o
[React Router](https://reactrouter.com/) is supported, including server-side rendering! See:

1. [React on Rails docs for React Router](../javascript/react-router.md)
2. Examples in [spec/dummy/app/views/react_router](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/app/views/react_router) and follow to the JavaScript code in the [spec/dummy/client/app/startup/ServerRouterApp.jsx](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/client/app/startup/ServerRouterApp.jsx).
2. Examples in [spec/dummy/app/views/react_router](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/app/views/react_router) and follow to the JavaScript code in the [spec/dummy/client/app/startup/RouterApp.server.jsx](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/client/app/startup/RouterApp.server.jsx).
3. [Code Splitting docs](../javascript/code-splitting.md) for information about how to set up code splitting for server rendered routes.

---
Expand Down
2 changes: 1 addition & 1 deletion docs/contributor-info/linters.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Rule severity is configured with `'off'`, `'warn'` or `'error'`. In older config

Rules can also take a few additional options. In this case, the rule can be set to an array, the first item of which is the severity and the rest are options.

See file [.eslintrc](https://github.com/shakacode/react_on_rails/tree/master/.eslintrc) for examples of configuration
See file [.eslintrc](https://github.com/shakacode/react_on_rails/tree/master/lib/generators/react_on_rails/templates/.eslintrc) for examples of configuration

### Specify/Override rules in code

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/webpack-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[Webpack](https://webpack.js.org) is the JavaScript npm package that prepares all your client-side assets. The Rails asset pipeline used to be the preferable way to prepare client-side assets.

[Shakapacker](https://github.com/shakcode/shakapacker) (the official successor of [rails/webpacker](https://github.com/rails/webpacker)) is the Ruby gem that mainly gives us 2 things:
[Shakapacker](https://github.com/shakacode/shakapacker) (the official successor of [rails/webpacker](https://github.com/rails/webpacker)) is the Ruby gem that mainly gives us 2 things:

1. View helpers for placing the Webpack bundles on your Rails views. React on Rails depends on these view helpers.
2. A layer of abstraction on top of Webpack customization. The base setup works great for the client-side Webpack configuration.
Expand Down
8 changes: 3 additions & 5 deletions docs/javascript/code-splitting.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,10 @@ There's an implemented example of code splitting in the `spec/dummy` folder of t

See:

- [spec/dummy/client/app/startup/client-bundle.js](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/client/app/startup/client-bundle.js)
- [spec/dummy/client/app/packs/client-bundle.js](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/client/app/packs/client-bundle.js)
- [spec/dummy/client/app/packs/server-bundle.js](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/client/app/packs/server-bundle.js)
- [spec/dummy/client/app/startup/DeferredRenderAppClient](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/client/app/startup/DeferredRenderAppClient.jsx) # Code splitting implemented here
- [spec/dummy/client/app/startup/DeferredRenderAppServer.jsx](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/client/app/startup/DeferredRenderAppServer.jsx)
- [spec/dummy/client/app/components/DeferredRender.jsx](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/client/app/components/DeferredRender.jsx)
- [spec/dummy/client/app/components/DeferredRenderAsyncPage.jsx](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/client/app/components/DeferredRenderAsyncPage.jsx)

_Note: The DeferredRender example components referenced in older versions of this document have been removed as this code splitting approach is outdated._

### Comparison of Server vs. Client Code

Expand Down
2 changes: 1 addition & 1 deletion docs/javascript/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const assetLoaderRules = [

```

A full example can be found at [spec/dummy/client/app/components/ImageExample/ImageExample.jsx](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/client/app/components/ImageExample/ImageExample.jsx)
A full example can be found at [spec/dummy/client/app/startup/ImageExample.jsx](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/client/app/startup/ImageExample.jsx)

You are free to use images either in image tags or as background images in SCSS files. You can
use a "global" location of /client/app/assets/images or a relative path to your JS or SCSS file, as
Expand Down
Loading