Test npm-deps with advanced compilation

This commit is contained in:
Juho Teperi 2017-07-12 23:00:59 +03:00
parent 580729178b
commit 1bf0dd3e5a
4 changed files with 2031 additions and 5 deletions

View File

@ -4,10 +4,10 @@
:description "A simple ClojureScript interface to React" :description "A simple ClojureScript interface to React"
:dependencies [[org.clojure/clojure "1.8.0"] :dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.748"] [org.clojure/clojurescript "1.9.762"]
; [cljsjs/react-dom "15.5.4-0"] ; [cljsjs/react-dom "15.6.1-1-SNAPSHOT"]
; [cljsjs/react-dom-server "15.5.4-0"] ; [cljsjs/react-dom-server "15.6.1-1-SNAPSHOT"]
; [cljsjs/create-react-class "15.5.3-0"] ; [cljsjs/create-react-class "15.6.0-1-SNAPSHOT"]
] ]
:plugins [[lein-cljsbuild "1.1.6"] :plugins [[lein-cljsbuild "1.1.6"]
@ -51,7 +51,7 @@
:pretty-print false :pretty-print false
;; :pseudo-names true ;; :pseudo-names true
:output-dir "target/client" :output-dir "target/client"
;; enables React production build ;; enables React production build - for npm-deps
:closure-defines {"process.env.NODE_ENV" "production"}}}}}}] :closure-defines {"process.env.NODE_ENV" "production"}}}}}}]
:prerender [:prod :prerender [:prod

View File

@ -0,0 +1,42 @@
/**
* @fileoverview Closure Compiler externs for Facebook ReactDOMServer.js DOM 0.14.0
* @see http://reactjs.org
* @externs
*/
/**
* The ReactDOMServer global object.
*
* @type {!Object}
* @const
*/
var ReactDOMServer = {};
/**
* The current version of ReactDOMServer.
*
* @type {string}
* @const
*/
ReactDOMServer.version;
/**
* Render a ReactElement to its initial HTML.
*
* @param {React.ReactElement} element
* @return {string}
*/
ReactDOMServer.renderToString = function(element) {};
/**
* Similar to renderToString, except this doesn't create extra DOM attributes
* such as data-react-id, that React uses internally. This is useful if you want
* to use React as a simple static page generator, as stripping away the extra
* attributes can save lots of bytes.
*
* @param {React.ReactElement} element
* @return {string}
*/
ReactDOMServer.renderToStaticMarkup = function(element) {};

77
src/react-dom.ext.js Normal file
View File

@ -0,0 +1,77 @@
/**
* @fileoverview Closure Compiler externs for Facebook ReactDOM.js DOM 0.14.0
* @see http://reactjs.org
* @externs
*/
/**
* The ReactDOM global object.
*
* @type {!Object}
* @const
* @suppress {const|duplicate}
*/
var ReactDOM = {};
/**
* The current version of ReactDOM.
*
* @type {string}
* @const
*/
ReactDOM.version;
/**
* @param {React.ReactComponent} container
* @param {Element} mountPoint
* @param {Function=} opt_callback
* @return {React.ReactComponent}
*/
ReactDOM.render = function(container, mountPoint, opt_callback) {};
/**
* @param {Element} container
* @return {boolean}
*/
ReactDOM.unmountComponentAtNode = function(container) {};
/**
* @param {React.ReactComponent} component
* @return {Element}
*/
ReactDOM.findDOMNode = function(component) {};
/**
* Call the provided function in a context within which calls to `setState`
* and friends are batched such that components aren't updated unnecessarily.
*
* @param {Function} callback Function which calls `setState`, `forceUpdate`, etc.
* @param {*=} opt_a Optional argument to pass to the callback.
* @param {*=} opt_b Optional argument to pass to the callback.
* @param {*=} opt_c Optional argument to pass to the callback.
* @param {*=} opt_d Optional argument to pass to the callback.
* @param {*=} opt_e Optional argument to pass to the callback.
* @param {*=} opt_f Optional argument to pass to the callback.
*/
ReactDOM.unstable_batchedUpdates = function(callback, opt_a, opt_b, opt_c, opt_d, opt_e, opt_f) {};
/**
* Renders a React component into the DOM in the supplied `container`.
*
* If the React component was previously rendered into `container`, this will
* perform an update on it and only mutate the DOM as necessary to reflect the
* latest React component.
*
* @param {React.ReactComponent} parentComponent The conceptual parent of this render tree.
* @param {React.ReactElement} nextElement Component element to render.
* @param {Element} container DOM element to render into.
* @param {Function=} opt_callback function triggered on completion
* @return {React.ReactComponent} Component instance rendered in `container`.
*/
ReactDOM.unstable_renderSubtreeIntoContainer = function(parentComponent, nextElement, container, opt_callback) {};

1907
src/react.ext.js Normal file

File diff suppressed because it is too large Load Diff