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

View File

@ -5,10 +5,17 @@ how you want to provide React.
| | Build | Browser | Node |
|---|---|---|---|
| Cljsjs | `:none` | Supported | Requires Cljs 1.10.145+ |
| Cljsjs | `:advanced` | Supported | Requires Cljs 1.10.145+ |
| `node modules` | `:none` | Supported | Supported |
| `node modules` | `:advanced` | Supported | Partially supported<br> (`ReactDOM/server` currently broken) |
| Cljsjs | `:none` | Supported | Requires Cljs 1.10.238+ |
| Cljsjs | `:advanced` | Supported | Requires Cljs 1.10.238+ |
| `node modules` | `:none` | Partially supported (1) | Supported |
| `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

View File

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

View File

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