Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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/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
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