Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 48f6511

Browse files
committed
good to go
1 parent 9422399 commit 48f6511

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Whitespace conventions:
2525
- `React::Server` is provided as a module wrapping the original `ReactDOMServer` API, require `react/server` to use it. (#186)
2626
- `React::Config` is introduced, `environment` is the only config option provided for now. See [#204](https://github.com/ruby-hyperloop/hyper-react/issues/204) for usage details.
2727

28+
### Changed
29+
30+
- State syntax is now consistent with Hyperloop::Store, old syntax is deprecated. (#209, #97)
31+
2832
### Deprecated
2933

3034
- Current ref callback behavior is deprecated. Require `"react/ref_callback"` to get the updated behavior. (#188)
@@ -34,10 +38,15 @@ Whitespace conventions:
3438
### Removed
3539

3640
- `react-latest` & `react-v1x` is removed. Use `react/react-source-browser` or `react/react-source-server` instead.
41+
- Support for Ruby < 2.0 is removed. (#201)
3742

3843
### Fixed
3944

4045
- [NativeLibrary] Passing native JS object as props will raise exception. (#195)
46+
- Returns better error message if result of rendering block is not suitable (#207)
47+
- Batch all state changes and execute *after* rendering cycle (#206, #178) (Code is now moved to Hyper::Store)
48+
You can revert to the old behavior by defining the `React::State::ALWAYS_UPDATE_STATE_AFTER_RENDER = false`
49+
- Memory Leak in render context fixed (#192)
4150

4251

4352
## [0.11.0] - 2016-12-13

lib/react/rendering_context.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ class << self
44
attr_accessor :waiting_on_resources
55

66
def render(name, *args, &block)
7+
was_outer_most = !@not_outer_most
8+
@not_outer_most = true
79
remove_nodes_from_args(args)
810
@buffer ||= [] unless @buffer
911
if block
@@ -31,6 +33,8 @@ def render(name, *args, &block)
3133
@buffer << element
3234
self.waiting_on_resources = nil
3335
element
36+
ensure
37+
@not_outer_most = @buffer = nil if was_outer_most
3438
end
3539

3640
def build

spec/spec_helper.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ def self.inherited(child)
4646
end
4747
end
4848

49+
module React
50+
class State
51+
# this messes with lots of tests, these tests will be retested in the new hyper-component gem tests
52+
ALWAYS_UPDATE_STATE_AFTER_RENDER = false
53+
end
54+
end
55+
4956
module Opal
5057
module RSpec
5158
module AsyncHelpers

0 commit comments

Comments
 (0)