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 2.1.1 to 2.2.0

17

CHANGELOG.md

@@ -7,2 +7,9 @@ # Change Log

## [Unreleased]
## [2.2.0] - 2016-01-29
##### Added
- New JavaScript API for debugging TurboLinks issues. Be sure to see [turbolinks docs](docs/additional_reading/turbolinks.md). `ReactOnRails.setOptions({ traceTurbolinks: true });`. Removed the file `debug_turbolinks` added in 2.1.1. See [#243](https://github.com/shakacode/react_on_rails/pull/243).
## [2.1.1] - 2016-01-28
##### Fixed

@@ -12,2 +19,3 @@ - Fixed regression where apps that were not using Turbolinks would not render components on page load.

##### Added
- `ReactOnRails.render` returns a virtualDomElement Reference to your React component's backing instance. See [#234](https://github.com/shakacode/react_on_rails/pull/234).
- `debug_turbolinks` helper for debugging turbolinks issues. See [turbolinks](docs/additional_reading/turbolinks.md).

@@ -77,3 +85,3 @@ - Enhanced regression testing for non-turbolinks apps. Runs all tests for dummy app with turbolinks both disabled and enabled.

##### Migration Steps
##### Migration Steps v1 to v2
[Example of upgrading](https://github.com/shakacode/react-webpack-rails-tutorial/commit/5b1b8698e8daf0f0b94e987740bc85ee237ef608)

@@ -88,3 +96,4 @@

7. Run `cd client && npm i --save react-on-rails` to get react-on-rails into your `client/package.json`.
8. You should also update any other dependencies if possible to match up with the [react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial/).
8. You should also update any other dependencies if possible to match up with the [react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial/). This includes updating to Babel 6.
9. If you want to stick with Babel 5 for a bit, see [Issue #238](https://github.com/shakacode/react_on_rails/issues/238).

@@ -126,3 +135,5 @@ ---

[Unreleased]: https://github.com/shakacode/react_on_rails/compare/v2.1.0...HEAD
[Unreleased]: https://github.com/shakacode/react_on_rails/compare/2.2.0...HEAD
[2.2.0]: https://github.com/shakacode/react_on_rails/compare/2.1.1...2.2.0
[2.1.1]: https://github.com/shakacode/react_on_rails/compare/v2.1.0...2.1.1
[2.1.0]: https://github.com/shakacode/react_on_rails/compare/v2.0.2...v2.1.0

@@ -129,0 +140,0 @@ [2.0.2]: https://github.com/shakacode/react_on_rails/compare/v2.0.1...v2.0.2

2

node_package/lib/clientStartup.js

@@ -37,3 +37,3 @@ 'use strict';

if (window.DEBUG_TURBOLINKS) {
if (ReactOnRails.option('traceTurbolinks')) {
var _console;

@@ -40,0 +40,0 @@

'use strict';
var _assign = require('babel-runtime/core-js/object/assign');
var _assign2 = _interopRequireDefault(_assign);
var _stringify = require('babel-runtime/core-js/json/stringify');
var _stringify2 = _interopRequireDefault(_stringify);
var _keys = require('babel-runtime/core-js/object/keys');
var _keys2 = _interopRequireDefault(_keys);
Object.defineProperty(exports, "__esModule", {

@@ -43,4 +55,28 @@ value: true

var DEFAULT_OPTIONS = {
traceTurbolinks: false
};
ctx.ReactOnRails = {
/**
* Set options for ReactOnRails, typically before you call ReactOnRails.register
* Available Options:
* `traceTurbolinks: true|false Gives you debugging messages on Turbolinks events
*/
setOptions: function setOptions(options) {
if (options.hasOwnProperty('traceTurbolinks')) {
this._options.traceTurbolinks = options.traceTurbolinks;
delete options.traceTurbolinks;
}
if ((0, _keys2.default)(options).length > 0) {
throw new Error('Invalid options passed to ReactOnRails.options: ', (0, _stringify2.default)(options));
}
},
option: function option(key) {
return this._options[key];
},
/**
* Main entry point to using the react-on-rails npm package. This is how Rails will be able to

@@ -50,3 +86,2 @@ * find you components for rendering.

*/
register: function register(components) {

@@ -111,7 +146,12 @@ _ComponentStore2.default.register(components);

return _ComponentStore2.default.components();
},
resetOptions: function resetOptions() {
this._options = (0, _assign2.default)({}, DEFAULT_OPTIONS);
}
};
ReactOnRails.resetOptions();
(0, _clientStartup2.default)(ctx);
exports.default = ctx.ReactOnRails;
{
"name": "react-on-rails",
"version": "2.1.1",
"version": "2.2.0",
"description": "react-on-rails JavaScript for react_on_rails Ruby gem",

@@ -53,2 +53,3 @@ "main": "node_package/lib/ReactOnRails.js",

"build": "node_package/scripts/build",
"build-watch": "$(npm bin)/babel --watch --out-dir node_package/lib node_package/src",
"eslint": "eslint . --ext .jsx and .js",

@@ -55,0 +56,0 @@ "jscs": "jscs . -e -v",

@@ -5,5 +5,5 @@ [![Build Status](https://travis-ci.org/shakacode/react_on_rails.svg?branch=master)](https://travis-ci.org/shakacode/react_on_rails) [![Coverage Status](https://coveralls.io/repos/shakacode/react_on_rails/badge.svg?branch=master&service=github)](https://coveralls.io/github/shakacode/react_on_rails?branch=master) [![Dependency Status](https://gemnasium.com/shakacode/react_on_rails.svg)](https://gemnasium.com/shakacode/react_on_rails) [![Gem Version](https://badge.fury.io/rb/react_on_rails.svg)](https://badge.fury.io/rb/react_on_rails) [![npm version](https://badge.fury.io/js/react-on-rails.svg)](https://badge.fury.io/js/react-on-rails)

* 2.1 has shipped on Tuesday, 2/26/2016. Please see the [Changelog](CHANGELOG.md) for details, and let us know if you see any issues! [Migration steps from 1.x](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md#migration-steps).
* 2.2 has shipped on Tuesday, 1/29/2016. Please see the [Changelog](CHANGELOG.md) for details, and let us know if you see any issues! [Migration steps from 1.x](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md#migration-steps-v1-to-v2).
* Highlights:
1. Fixed a **critical** problem with TurboLinks.
1. Fixed a **critical** problem with TurboLinks. Be sure to see [turbolinks docs](docs/additional_reading/turbolinks.md) for more information on how to debug TurboLinks issues.
2. Provides a convenient helper to ensure that JavaScript assets are compiled before running tests.

@@ -382,2 +382,3 @@ * React on Rails does not yet have *generator* support for building new apps that use CSS modules and hot reloading via the Rails server as is demonstrated in the [shakacode/react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial/). *We do support this, but we don't generate the code.* If you did generate a fresh app from react_on_rails and want to move to CSS Modules, then see [PR 175: Babel 6 / CSS Modules / Rails hot reloading](https://github.com/shakacode/react-webpack-rails-tutorial/pull/175). Note, while there are probably fixes after this PR was accepted, this has the majority of the changes. See [the tutorial](https://github.com/shakacode/react-webpack-rails-tutorial/#news) for more information. Ping us if you want to help!

+ [The React on Rails Doctrine](http://www.shakacode.com/2016/01/26/the-react-on-rails-doctrine.html)
+ [Babel](docs/additional_reading/babel.md)
+ [Generated Client Code](docs/additional_reading/generated_client_code.md)

@@ -384,0 +385,0 @@ + [Heroku Deployment](docs/additional_reading/heroku_deployment.md)

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