Document React 16 problems with npm-deps

This commit is contained in:
Juho Teperi 2018-04-03 10:53:05 +03:00
parent efe84857b9
commit 12d590ff15
4 changed files with 16 additions and 9 deletions

View File

@ -18,6 +18,7 @@ jobs:
paths: paths:
- ~/.m2 - ~/.m2
- ~/.lein - ~/.lein
- ~/.cljs/.aot_cache
key: reagent-{{ checksum "project.clj" }} key: reagent-{{ checksum "project.clj" }}
- save_cache: - save_cache:
paths: paths:
@ -29,7 +30,7 @@ jobs:
deploy_master: deploy_master:
working_directory: ~/work working_directory: ~/work
docker: docker:
- image: circleci/clojure:lein-2.7.2 - image: circleci/clojure:lein-2.8.1
steps: steps:
- checkout - checkout
- add_ssh_keys - add_ssh_keys

View File

@ -5,10 +5,17 @@ how you want to provide React.
| | Build | Browser | Node | | | Build | Browser | Node |
|---|---|---|---| |---|---|---|---|
| Cljsjs | `:none` | Supported | Requires Cljs 1.10.145+ | | Cljsjs | `:none` | Supported | Requires Cljs 1.10.238+ |
| Cljsjs | `:advanced` | Supported | Requires Cljs 1.10.145+ | | Cljsjs | `:advanced` | Supported | Requires Cljs 1.10.238+ |
| `node modules` | `:none` | Supported | Supported | | `node modules` | `:none` | Partially supported (1) | Supported |
| `node modules` | `:advanced` | Supported | Partially supported<br> (`ReactDOM/server` currently broken) | | `node modules` | `:advanced` | Partially supported (2) | Supported |
1. Closure can't properly handle React 16 CommonJS module pattern: https://github.com/google/closure-compiler/issues/2841
This causes the production React code being loaded even for development builds.
Using Chrome React Developer Tools with this setup will break Reagent.
2. Closure optimization currently breaks certain statically created objects which are
accessed dynamically in `ReactDOM/server`: https://github.com/facebook/react/issues/12368
## Browser - Cljsjs ## Browser - Cljsjs

View File

@ -58,8 +58,9 @@
:source-map true :source-map true
:optimizations :none :optimizations :none
:main "reagentdemo.dev" :main "reagentdemo.dev"
:output-dir "target/cljsbuild/client-npm/public/js/out" ;; Same output dir as :client build!
:output-to "target/cljsbuild/client-npm/public/js/main.js" :output-dir "target/cljsbuild/client/public/js/out"
:output-to "target/cljsbuild/client/public/js/main.js"
:asset-path "js/out" :asset-path "js/out"
;; add process.env.node_env preload ;; add process.env.node_env preload
; :npm-deps true ; :npm-deps true

View File

@ -194,8 +194,6 @@
(fn [] (fn []
(is (= @a-count 3)) (is (= @a-count 3))
(is (= @b-count 1))) (is (= @b-count 1)))
(fn []
(js/console.log "test-cursor done"))
done))))))) done)))))))
(deftest test-fn-cursor (deftest test-fn-cursor