Skip to content

Commit 027d135

Browse files
committed
per review
1 parent 0a0273f commit 027d135

4 files changed

Lines changed: 18 additions & 11 deletions

File tree

.circleci/config.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,25 +69,25 @@ aliases:
6969
- &restore-package-node-modules-cache
7070
name: Restore cached node_modules directory
7171
keys:
72-
- v4-package-node-modules-cache-{{ checksum "yarn.lock" }}
72+
- v5-package-node-modules-cache-{{ checksum "yarn.lock" }}
7373

7474
# Restore spec/dummy/node_modules dir from cache using yarn.lock checksum as a key.
7575
- &restore-dummy-app-node-modules-cache
7676
name: Restore cached spec/dummy/node_modules directory
7777
keys:
78-
- v4-dummy-app-node-modules-cache-{{ checksum "spec/dummy/yarn.lock" }}
78+
- v5-dummy-app-node-modules-cache-{{ checksum "spec/dummy/yarn.lock" }}
7979

8080
# Restore vendor/bundle dir from cache using Gemfile.lock checksum as a key.
8181
- &restore-dummy-app-gem-cache
8282
name: Restore cached Ruby Gems for dummy app
8383
keys:
84-
- v4-dummy-app-gem-cache-{{ checksum "spec/dummy/Gemfile.lock" }}
84+
- v5-dummy-app-gem-cache-{{ checksum "spec/dummy/Gemfile.lock" }}
8585

8686
# Restore vendor/bundle dir from cache using react_on_rails.gemspec checksum as a key.
8787
- &restore-package-gem-cache
8888
name: Restore cached Ruby Gems for package
8989
keys:
90-
- v4-package-app-gem-cache-{{ checksum "react_on_rails.gemspec" }}
90+
- v5-package-app-gem-cache-{{ checksum "react_on_rails.gemspec" }}
9191

9292
# NOTE: Sometimes CI generated docker images are not updated in time to keep up with the minimum required
9393
# by chromedriver versions of Chrome. Just bump here Chrome version if chromedriver raises errors
@@ -139,7 +139,7 @@ jobs:
139139
- run: *install-package-node-modules
140140
- save_cache:
141141
name: Save root node_modules to cache
142-
key: v4-package-node-modules-cache-{{ checksum "yarn.lock" }}
142+
key: v5-package-node-modules-cache-{{ checksum "yarn.lock" }}
143143
paths:
144144
- node_modules
145145

@@ -157,7 +157,7 @@ jobs:
157157
- run: *install-dummy-app-node-modules
158158
- save_cache:
159159
name: Save spec/dummy/node_modules to cache
160-
key: v4-dummy-app-node-modules-cache-{{ checksum "spec/dummy/yarn.lock" }}
160+
key: v5-dummy-app-node-modules-cache-{{ checksum "spec/dummy/yarn.lock" }}
161161
paths:
162162
- spec/dummy/node_modules
163163
- spec/dummy/node_modules
@@ -172,7 +172,7 @@ jobs:
172172
- run: *install-package-ruby-gems
173173
- save_cache:
174174
name: Save dummy app ruby gems to cache
175-
key: v4-package-app-gem-cache-{{ checksum "react_on_rails.gemspec" }}
175+
key: v5-package-app-gem-cache-{{ checksum "react_on_rails.gemspec" }}
176176
paths:
177177
- vendor/bundle
178178

@@ -186,7 +186,7 @@ jobs:
186186
- run: *install-dummy-app-ruby-gems
187187
- save_cache:
188188
name: Save dummy app ruby gems to cache
189-
key: v4-dummy-app-gem-cache-{{ checksum "spec/dummy/Gemfile.lock" }}
189+
key: v5-dummy-app-gem-cache-{{ checksum "spec/dummy/Gemfile.lock" }}
190190
paths:
191191
- spec/dummy/vendor/bundle
192192

@@ -209,7 +209,7 @@ jobs:
209209
command: cd spec/dummy && yarn run build:test
210210
- save_cache:
211211
name: Save test webpack bundles to cache (for build number checksum used by rspec job)
212-
key: v4-dummy-app-webpack-bundle-{{ .Revision }}
212+
key: v5-dummy-app-webpack-bundle-{{ .Revision }}
213213
paths:
214214
- spec/dummy/public/webpack
215215
# Run JS unit tests for Renderer package.
@@ -249,7 +249,7 @@ jobs:
249249
- restore_cache: *restore-dummy-app-gem-cache
250250
- restore_cache:
251251
name: Restore cached webpack bundles for dummy app
252-
key: v4-dummy-app-webpack-bundle-{{ .Revision }}
252+
key: v5-dummy-app-webpack-bundle-{{ .Revision }}
253253
- restore_cache: *restore-dummy-app-node-modules-cache
254254
- restore_cache: *restore-package-node-modules-cache
255255
- run: *install-package-node-modules

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ Changes since last non-beta release.
1717

1818
*Please add entries here for your pull requests that are not yet released.*
1919

20+
#### Added
21+
22+
- Ability to skip stubbing of setTimeout, setInterval, & clearTimeout polyfills when using properly configured React on Rails Pro. Also, ability to have render functions return a promise to be awaited by React on Rails Pro Node Renderer. [PR 1380](https://github.com/shakacode/react_on_rails/pull/1380) by [judahmeek](https://github.com/judahmeek)
23+
2024
### [12.3.0] - 2021-07-26
2125
#### Added
2226

lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def create_js_context
150150
end
151151

152152
def execjs_timer_polyfills
153-
if ReactOnRails::Utils.react_on_rails_pro? && ReactOnRailsPro.configuration.server_renderer == "NodeRenderer"
153+
if ReactOnRails::Utils.react_on_rails_pro? && ReactOnRailsPro.configuration.execjs_polyfills == false
154154
return ""
155155
end
156156

node_package/src/serverRenderReactComponent.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ ROUTER REDIRECT: ${name} to dom node with id: ${domNodeId}, redirect to ${redire
5757
renderResult = (reactElementOrRouterResult as { renderedHtml: string }).renderedHtml;
5858
}
5959
} else if (isPromise(reactElementOrRouterResult)) {
60+
if (!returnPromise) {
61+
console.error(`Your render function returned a Promise, which is only supported by a node renderer, not ExceJS.`)
62+
}
6063
renderResult = reactElementOrRouterResult;
6164
} else {
6265
try {

0 commit comments

Comments
 (0)