Skip to content

Commit

Permalink
add note about om
Browse files Browse the repository at this point in the history
  • Loading branch information
piranha committed Feb 10, 2014
1 parent 58ca8bc commit 463ca85
Show file tree
Hide file tree
Showing 48 changed files with 693 additions and 385 deletions.
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ gcc-react:

adv-react:
cd resources/static && closure-compiler \
--compilation_level ADVANCED_OPTIMIZATIONS \
--externs ../externs/react.js \
--js_output_file react.adv-min.js \
--externs ../externs/react.js \
--compilation_level ADVANCED_OPTIMIZATIONS \
--create_source_map %outname%.map \
--source_map_format=V3 \
../react/*.js
Expand All @@ -61,3 +61,13 @@ adv-dumb:
--compilation_level ADVANCED_OPTIMIZATIONS \
--js_output_file resources/static/dumb.adv.js \
resources/react/*.js resources/static/dumbchat.js

qwe:
cd resources/target && closure-compiler \
--compilation_level ADVANCED_OPTIMIZATIONS \
--js_output_file pump.min.js \
--create_source_map %outname%.map \
--source_map_format=V3 \
pump.js
echo '//@ sourceMappingURL=pump.min.js.map' >> resources/target/pump.min.js

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Pump

Pump are ClojureScript bindings for [React][1].
Note: Pump is deprecated in favor of [om](https://github.com/swannodette/om/).

Pump is ClojureScript bindings for [React][1].

## Usage

Expand Down
2 changes: 0 additions & 2 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
:optimizations :advanced}}
{:id "map"
:source-paths ["src"]
;; map brings full paths so it's necessary to build it in place
;; plus it requires to be served from http://, not from file://
:compiler {:output-to "pump.min.js"
:source-map "pump.min.js.map"
;; :externs ["resources/externs/react.js"]
Expand Down
31 changes: 29 additions & 2 deletions resources/react/module$DOMPropertyOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ var memoizeStringOnly$$module$DOMPropertyOperations = module$memoizeStringOnly;
var processAttributeNameAndPrefix$$module$DOMPropertyOperations = memoizeStringOnly$$module$DOMPropertyOperations(function(name) {
return escapeTextForBrowser$$module$DOMPropertyOperations(name) + '="'
});
if(false) {
var reactProps$$module$DOMPropertyOperations = {children:true, dangerouslySetInnerHTML:true, key:true, ref:true};
var warnedProperties$$module$DOMPropertyOperations = {};
var warnUnknownProperty$$module$DOMPropertyOperations = function(name) {
if(reactProps$$module$DOMPropertyOperations[name] || warnedProperties$$module$DOMPropertyOperations[name]) {
return
}
warnedProperties$$module$DOMPropertyOperations[name] = true;
var lowerCasedName = name.toLowerCase();
var standardName = DOMProperty$$module$DOMPropertyOperations.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty$$module$DOMPropertyOperations.getPossibleStandardName[lowerCasedName];
if(standardName != null) {
console.warn("Unknown DOM property " + name + ". Did you mean " + standardName + "?")
}
}
}
var DOMPropertyOperations$$module$DOMPropertyOperations = {createMarkupForProperty:function(name, value) {
if(DOMProperty$$module$DOMPropertyOperations.isStandardName[name]) {
if(value == null || DOMProperty$$module$DOMPropertyOperations.hasBooleanValue[name] && !value) {
Expand All @@ -22,6 +37,10 @@ var DOMPropertyOperations$$module$DOMPropertyOperations = {createMarkupForProper
return""
}
return processAttributeNameAndPrefix$$module$DOMPropertyOperations(name) + escapeTextForBrowser$$module$DOMPropertyOperations(value) + '"'
}else {
if(false) {
warnUnknownProperty$$module$DOMPropertyOperations(name)
}
}
}
return null
Expand All @@ -35,7 +54,7 @@ var DOMPropertyOperations$$module$DOMPropertyOperations = {createMarkupForProper
if(DOMProperty$$module$DOMPropertyOperations.hasBooleanValue[name] && !value) {
node.removeAttribute(DOMProperty$$module$DOMPropertyOperations.getAttributeName[name])
}else {
node.setAttribute(DOMProperty$$module$DOMPropertyOperations.getAttributeName[name], value)
node.setAttribute(DOMProperty$$module$DOMPropertyOperations.getAttributeName[name], "" + value)
}
}else {
var propName = DOMProperty$$module$DOMPropertyOperations.getPropertyName[name];
Expand All @@ -46,7 +65,11 @@ var DOMPropertyOperations$$module$DOMPropertyOperations = {createMarkupForProper
}
}else {
if(DOMProperty$$module$DOMPropertyOperations.isCustomAttribute(name)) {
node.setAttribute(name, value)
node.setAttribute(name, "" + value)
}else {
if(false) {
warnUnknownProperty$$module$DOMPropertyOperations(name)
}
}
}
}, deleteValueForProperty:function(node, name) {
Expand All @@ -65,6 +88,10 @@ var DOMPropertyOperations$$module$DOMPropertyOperations = {createMarkupForProper
}else {
if(DOMProperty$$module$DOMPropertyOperations.isCustomAttribute(name)) {
node.removeAttribute(name)
}else {
if(false) {
warnUnknownProperty$$module$DOMPropertyOperations(name)
}
}
}
}};
Expand Down
4 changes: 4 additions & 0 deletions resources/react/module$Danger.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ var Danger$$module$Danger = {dangerouslyRenderMarkup:function(markupList) {
invariant$$module$Danger(!resultList.hasOwnProperty(resultIndex));
resultList[resultIndex] = renderNode;
resultListAssignmentCount += 1
}else {
if(false) {
console.error("Danger: Discarding unexpected node:", renderNode)
}
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions resources/react/module$DefaultDOMPropertyConfig.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions resources/react/module$EventConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ var module$EventConstants = {};
goog.require("module$keyMirror");
var keyMirror$$module$EventConstants = module$keyMirror;
var PropagationPhases$$module$EventConstants = keyMirror$$module$EventConstants({bubbled:null, captured:null});
var topLevelTypes$$module$EventConstants = keyMirror$$module$EventConstants({topBlur:null, topChange:null, topClick:null, topCompositionEnd:null, topCompositionStart:null, topCompositionUpdate:null, topCopy:null, topCut:null, topDoubleClick:null, topDrag:null, topDragEnd:null, topDragEnter:null, topDragExit:null, topDragLeave:null, topDragOver:null, topDragStart:null, topDrop:null, topFocus:null, topInput:null, topKeyDown:null, topKeyPress:null, topKeyUp:null, topMouseDown:null, topMouseMove:null,
topMouseOut:null, topMouseOver:null, topMouseUp:null, topPaste:null, topScroll:null, topSelectionChange:null, topSubmit:null, topTouchCancel:null, topTouchEnd:null, topTouchMove:null, topTouchStart:null, topWheel:null});
var topLevelTypes$$module$EventConstants = keyMirror$$module$EventConstants({topBlur:null, topChange:null, topClick:null, topCompositionEnd:null, topCompositionStart:null, topCompositionUpdate:null, topContextMenu:null, topCopy:null, topCut:null, topDoubleClick:null, topDrag:null, topDragEnd:null, topDragEnter:null, topDragExit:null, topDragLeave:null, topDragOver:null, topDragStart:null, topDrop:null, topFocus:null, topInput:null, topKeyDown:null, topKeyPress:null, topKeyUp:null, topMouseDown:null,
topMouseMove:null, topMouseOut:null, topMouseOver:null, topMouseUp:null, topPaste:null, topScroll:null, topSelectionChange:null, topSubmit:null, topTouchCancel:null, topTouchEnd:null, topTouchMove:null, topTouchStart:null, topWheel:null});
var EventConstants$$module$EventConstants = {topLevelTypes:topLevelTypes$$module$EventConstants, PropagationPhases:PropagationPhases$$module$EventConstants};
module$EventConstants.module$exports = EventConstants$$module$EventConstants;
if(module$EventConstants.module$exports) {
Expand Down
3 changes: 3 additions & 0 deletions resources/react/module$EventListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ var EventListener$$module$EventListener = {listen:function(el, handlerBaseName,
}
}, capture:function(el, handlerBaseName, cb) {
if(!el.addEventListener) {
if(false) {
console.error("You are attempting to use addEventlistener " + "in a browser that does not support it support it." + "This likely means that you will not receive events that " + "your application relies on (such as scroll).")
}
return
}else {
el.addEventListener(handlerBaseName, cb, true)
Expand Down
Loading

0 comments on commit 463ca85

Please sign in to comment.