Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-on-rails

Package Overview
Dependencies
Maintainers
1
Versions
204
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-on-rails - npm Package Compare versions

Comparing version 11.1.4 to 11.1.5

2

node_package/lib/clientStartup.js

@@ -216,3 +216,3 @@ "use strict";

if (!turbolinksInstalled() || !turbolinksSupported()) {
if (document.readyState === 'complete' || document.readyState !== 'loading' && !document.documentElement.doScroll) {
if (document.readyState === 'complete') {
debugTurbolinks('NOT USING TURBOLINKS: DOM is already loaded, calling reactOnRailsPageLoaded');

@@ -219,0 +219,0 @@ reactOnRailsPageLoaded();

{
"name": "react-on-rails",
"version": "11.1.4",
"version": "11.1.5",
"description": "react-on-rails JavaScript for react_on_rails Ruby gem",

@@ -5,0 +5,0 @@ "main": "node_package/lib/ReactOnRails.js",

@@ -15,3 +15,3 @@ # ReactOnRails

To provide an opinionated and optimal framework for integrating Ruby on Rails with React via the [**Webpacker**](https://github.com/rails/webpacker) gem.
To provide an opinionated and optimal framework for integrating Ruby on Rails with React via the [**Webpacker**](https://github.com/rails/webpacker) gem especially in regards to React Server Rendering.

@@ -31,2 +31,6 @@ ## Features and Why React on Rails?

## ShakaCode Forum Premium Content
_Requires creating a free account._
* [How to use different versions of a file for client and server rendering](https://forum.shakacode.com/t/how-to-use-different-versions-of-a-file-for-client-and-server-rendering/1352)
## React on Rails Pro and ShakaCode Pro Support

@@ -38,3 +42,3 @@

* [HVMN’s 90% Reduction in Server Response Time from React on Rails Pro](https://medium.com/@railsonmaui/hvmns-90-reduction-in-server-response-time-from-react-on-rails-pro-eb08226687db)
* [HVMN’s 90% Reduction in Server Response Time from React on Rails Pro](https://blog.shakacode.com/hvmns-90-reduction-in-server-response-time-from-react-on-rails-pro-eb08226687db)
* [Egghead React on Rails Pro Deployment Highlights](https://github.com/shakacode/react_on_rails/wiki/Egghead-React-on-Rails-Pro-Deployment-Highlights)

@@ -244,6 +248,8 @@

You may want different initialization for your server-rendered components. For example, if you have an animation that runs when a component is displayed, you might need to turn that off when server rendering. However, the `railsContext` will tell you if your JavaScript code is running client side or server side. So code that required a different server bundle previously may no longer require this. Note, checking if `window` is defined has a similar effect.
You may want different code for your server-rendered components running server side versus client side. For example, if you have an animation that runs when a component is displayed, you might need to turn that off when server rendering. One way to handle this is conditional code like `if (window) { doClientOnlyCode() }`.
If you want different code to run, you will set up a separate webpack compilation file and you will specify a different, server side entry file. ex. 'serverHelloWorld.jsx'. Note: you might be initializing HelloWorld with version specialized for server rendering.
Another way is to use a separate webpack configuration file that can use a different server side entry file, like 'serverRegistration.js' as opposed to 'clientRegistration.js.' That would set up different code for server rendering.
For details on techniques to use different code for client and server rendering, see: [How to use different versions of a file for client and server rendering](https://forum.shakacode.com/t/how-to-use-different-versions-of-a-file-for-client-and-server-rendering/1352). (_Requires creating a free account._)
## Specifying Your React Components: Direct or Generator Functions

@@ -250,0 +256,0 @@

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc