Skip to content

Commit

Permalink
v2.0.0
Browse files Browse the repository at this point in the history
Updated to React 0.13 & newforms 0.12, removing dependency on React.addons in the browser bundle
Update devDependencies
Don't render demos to <body>
  • Loading branch information
insin committed Mar 11, 2015
1 parent e3788a4 commit c731520
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 56 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2.0.0 / 2015-03-11

Upgraded to React 0.13 and newforms 0.12 - the browser bundle no longer requires
use of the react-with-addons bundle.

# 1.1.1 / 2015-01-21

Fixed: uncompressed browser bundle was not actually in development mode, as
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ performs dead-code elimination, such as

### Browser bundle

**Note: the browser bundle expects to be able to use `React.addons.cloneWithProps()`
for grid components, so you must use the react-with-addons React bundle in order
to make use of them.**

The browser bundle exposes a global `BootstrapForm` variable and expects to
find global `React` ([React](http://facebook.github.io/react/)) and `forms`
([newforms](https://github.com/insin/newforms)) variables to work with.
Expand Down
13 changes: 7 additions & 6 deletions demo/allfields.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<head>
<meta charset="UTF-8">
<title>All Default Fields &amp; Widgets | newforms-bootstrap</title>
<script src="http://fb.me/react-with-addons-0.12.2.js"></script>
<script src="http://fb.me/JSXTransformer-0.12.2.js"></script>
<script src="../../newforms/build/newforms.js"></script>
<script src="http://fb.me/react-0.13.0.js"></script>
<script src="http://fb.me/JSXTransformer-0.13.0.js"></script>
<script src="../../newforms/dist/newforms.js"></script>
<script src="../dist/newforms-bootstrap.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
</head>
<body>
<script type="text/jsx;harmony=true">void function() {
'use strict'
<div id="app"></div>
<script type="text/jsx;harmony=true">void function() { 'use strict';

var choices = [
[1, 'foo']
Expand Down Expand Up @@ -129,6 +129,7 @@ <h1>All Default Fields &amp; Widgets <small>(rendered with <a href="https://gith
}
})

React.render(<App/>, document.body)
React.render(<App/>, document.getElementById('app'))

}()</script>
</body>
23 changes: 12 additions & 11 deletions demo/grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<head>
<meta charset="UTF-8">
<title>Grid Components | newforms-bootstrap</title>
<script src="http://fb.me/react-with-addons-0.12.2.js"></script>
<script src="http://fb.me/JSXTransformer-0.12.2.js"></script>
<script src="../../newforms/build/newforms.js"></script>
<script src="../dist/newforms-bootstrap.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
<script src="http://fb.me/react-0.13.0.js"></script>
<script src="http://fb.me/JSXTransformer-0.13.0.js"></script>
<script src="../../newforms/dist/newforms.js"></script>
<script src="../dist/newforms-bootstrap.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
<style>
.AutoTest .row > div {
text-align: center;
Expand All @@ -28,8 +28,8 @@
</style>
</head>
<body>
<script type="text/jsx;harmony=true">void function() {
'use strict'
<div id="app"></div>
<script type="text/jsx;harmony=true">void function() { 'use strict';

var {Col, Container, Row, Field} = BootstrapForm

Expand All @@ -54,7 +54,7 @@
}, 1000 + Math.random() * 1000)
},

clean(cb) {
clean: ['productName', 'vendor', function(cb) {
var {productDescription} = this.cleanedData
if (productDescription && productDescription.toLowerCase().indexOf('clowns') != -1) {
throw forms.ValidationError('No clowns!')
Expand All @@ -70,7 +70,7 @@
}
cb(null)
}, 1000 + Math.random() * 1000)
}
}]
})

var App = React.createClass({
Expand Down Expand Up @@ -296,6 +296,7 @@ <h2 id="autocolumnstest">Auto Column Widths Test</h2>
}
})

React.render(<App/>, document.body)
React.render(<App/>, document.getElementById('app'))

}()</script>
</body>
13 changes: 7 additions & 6 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<head>
<meta charset="UTF-8">
<title>The Form of Death | newforms-bootstrap</title>
<script src="http://fb.me/react-with-addons-0.12.2.js"></script>
<script src="http://fb.me/JSXTransformer-0.12.2.js"></script>
<script src="../../newforms/build/newforms.js"></script>
<script src="http://fb.me/react-0.13.0.js"></script>
<script src="http://fb.me/JSXTransformer-0.13.0.js"></script>
<script src="../../newforms/dist/newforms.js"></script>
<script src="../dist/newforms-bootstrap.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
</head>
<body>
<script type="text/jsx;harmony=true">void function() {
'use strict'
<div id="app"></div>
<script type="text/jsx;harmony=true">void function() { 'use strict';

function cap(s) {
return s.charAt(0).toUpperCase() + s.slice(1)
Expand Down Expand Up @@ -139,6 +139,7 @@ <h1>The Form of Death <small>(some <a href="https://www.youtube.com/watch?v=cV0t
}
})

React.render(<App/>, document.body)
React.render(<App/>, document.getElementById('app'))

}()</script>
</body>
9 changes: 4 additions & 5 deletions dist/newforms-bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/*!
* newforms-bootstrap 1.1.1 - https://github.com/insin/newforms-bootstrap
* newforms-bootstrap 2.0.0 - https://github.com/insin/newforms-bootstrap
* MIT Licensed
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o;"undefined"!=typeof window?o=window:"undefined"!=typeof global?o=global:"undefined"!=typeof self&&(o=self),o.BootstrapForm=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.BootstrapForm = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';

var React = (typeof window !== "undefined" ? window.React : typeof global !== "undefined" ? global.React : null)
var cloneWithProps = React.addons.cloneWithProps

var $__0=

Expand Down Expand Up @@ -437,7 +436,7 @@ var Container = React.createClass({displayName: "Container",
formErrors.isPopulated() && React.createElement("div", {key: form.addPrefix('__all__'), className: "alert alert-danger has-error"},
formErrors.messages().map(errorMessage)
),
React.Children.map(this.props.children, function(row, index) {return cloneWithProps(row, {
React.Children.map(this.props.children, function(row, index) {return React.cloneElement(row, {
autoColumns: this.props.autoColumns
, form: this.props.form
, index: index
Expand Down Expand Up @@ -470,7 +469,7 @@ var Row = React.createClass({displayName: "Row",
}
return React.createElement("div", {className: cx('row', this.props.className)},
React.Children.map(this.props.children, function(child, index) {
return cloneWithProps(child, extend({
return React.cloneElement(child, extend({
form: this.props.form
, spinner: this.props.spinner
}, columnProps[index]))
Expand Down
Loading

0 comments on commit c731520

Please sign in to comment.