react-on-rails 13.3.5 → 13.4.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.
package/README.md CHANGED
@@ -113,6 +113,11 @@ The following companies support our open source projects, and ShakaCode uses the
113
113
  <img alt="ScoutAPM" src="https://user-images.githubusercontent.com/4244251/184881152-9f2d8fba-88ac-4ba6-873b-22387f8711c5.png" height="120px">
114
114
  </picture>
115
115
  </a>
116
+ <a href="https://controlplane.com">
117
+ <picture>
118
+ <img alt="Control Plane" src="https://github.com/shakacode/.github/assets/20628911/90babd87-62c4-4de3-baa4-3d78ef4bec25" height="120px">
119
+ </picture>
120
+ </a>
116
121
  <br />
117
122
  <a href="https://www.browserstack.com">
118
123
  <picture>
@@ -40,6 +40,9 @@ var ctx = (0, context_1.default)();
40
40
  if (ctx === undefined) {
41
41
  throw new Error("The context (usually Window or NodeJS's Global) is undefined.");
42
42
  }
43
+ if (ctx.ReactOnRails !== undefined) {
44
+ throw new Error("\n The ReactOnRails value exists in the ".concat(ctx, " scope, it may not be safe to overwrite it.\n \n This could be caused by setting Webpack's optimization.runtimeChunk to \"true\" or \"multiple,\" rather than \"single.\" Check your Webpack configuration.\n \n Read more at https://github.com/shakacode/react_on_rails/issues/1558.\n "));
45
+ }
43
46
  var DEFAULT_OPTIONS = {
44
47
  traceTurbolinks: false,
45
48
  turbo: false,
@@ -1,2 +1,4 @@
1
1
  import type { RenderParams, RenderResult } from './types/index';
2
- export default function serverRenderReactComponent(options: RenderParams): null | string | Promise<RenderResult>;
2
+ declare function serverRenderReactComponentInternal(options: RenderParams): null | string | Promise<RenderResult>;
3
+ declare const serverRenderReactComponent: typeof serverRenderReactComponentInternal;
4
+ export default serverRenderReactComponent;
@@ -45,7 +45,7 @@ var createReactOutput_1 = __importDefault(require("./createReactOutput"));
45
45
  var isServerRenderResult_1 = require("./isServerRenderResult");
46
46
  var buildConsoleReplay_1 = __importDefault(require("./buildConsoleReplay"));
47
47
  var handleError_1 = __importDefault(require("./handleError"));
48
- function serverRenderReactComponent(options) {
48
+ function serverRenderReactComponentInternal(options) {
49
49
  var _this = this;
50
50
  var name = options.name, domNodeId = options.domNodeId, trace = options.trace, props = options.props, railsContext = options.railsContext, renderingReturnsPromises = options.renderingReturnsPromises, throwJsErrors = options.throwJsErrors;
51
51
  var renderResult = null;
@@ -178,4 +178,14 @@ function serverRenderReactComponent(options) {
178
178
  }
179
179
  return JSON.stringify(result);
180
180
  }
181
+ var serverRenderReactComponent = function (options) {
182
+ try {
183
+ return serverRenderReactComponentInternal(options);
184
+ }
185
+ finally {
186
+ // Reset console history after each render.
187
+ // See `RubyEmbeddedJavaScript.console_polyfill` for initialization.
188
+ console.history = [];
189
+ }
190
+ };
181
191
  exports.default = serverRenderReactComponent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-on-rails",
3
- "version": "13.3.5",
3
+ "version": "13.4.0",
4
4
  "description": "react-on-rails JavaScript for react_on_rails Ruby gem",
5
5
  "main": "node_package/lib/ReactOnRails.js",
6
6
  "directories": {