Skip to content

Commit c731520

Browse files
committed
v2.0.0
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>
1 parent e3788a4 commit c731520

File tree

9 files changed

+58
-56
lines changed

9 files changed

+58
-56
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 2.0.0 / 2015-03-11
2+
3+
Upgraded to React 0.13 and newforms 0.12 - the browser bundle no longer requires
4+
use of the react-with-addons bundle.
5+
16
# 1.1.1 / 2015-01-21
27

38
Fixed: uncompressed browser bundle was not actually in development mode, as

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ performs dead-code elimination, such as
3737

3838
### Browser bundle
3939

40-
**Note: the browser bundle expects to be able to use `React.addons.cloneWithProps()`
41-
for grid components, so you must use the react-with-addons React bundle in order
42-
to make use of them.**
43-
4440
The browser bundle exposes a global `BootstrapForm` variable and expects to
4541
find global `React` ([React](http://facebook.github.io/react/)) and `forms`
4642
([newforms](https://github.com/insin/newforms)) variables to work with.

demo/allfields.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
<head>
33
<meta charset="UTF-8">
44
<title>All Default Fields &amp; Widgets | newforms-bootstrap</title>
5-
<script src="http://fb.me/react-with-addons-0.12.2.js"></script>
6-
<script src="http://fb.me/JSXTransformer-0.12.2.js"></script>
7-
<script src="../../newforms/build/newforms.js"></script>
5+
<script src="http://fb.me/react-0.13.0.js"></script>
6+
<script src="http://fb.me/JSXTransformer-0.13.0.js"></script>
7+
<script src="../../newforms/dist/newforms.js"></script>
88
<script src="../dist/newforms-bootstrap.js"></script>
99
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
1010
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
1111
</head>
1212
<body>
13-
<script type="text/jsx;harmony=true">void function() {
14-
'use strict'
13+
<div id="app"></div>
14+
<script type="text/jsx;harmony=true">void function() { 'use strict';
1515

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

132-
React.render(<App/>, document.body)
132+
React.render(<App/>, document.getElementById('app'))
133+
133134
}()</script>
134135
</body>

demo/grid.html

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<head>
33
<meta charset="UTF-8">
44
<title>Grid Components | newforms-bootstrap</title>
5-
<script src="http://fb.me/react-with-addons-0.12.2.js"></script>
6-
<script src="http://fb.me/JSXTransformer-0.12.2.js"></script>
7-
<script src="../../newforms/build/newforms.js"></script>
8-
<script src="../dist/newforms-bootstrap.js"></script>
9-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
10-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
5+
<script src="http://fb.me/react-0.13.0.js"></script>
6+
<script src="http://fb.me/JSXTransformer-0.13.0.js"></script>
7+
<script src="../../newforms/dist/newforms.js"></script>
8+
<script src="../dist/newforms-bootstrap.js"></script>
9+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
10+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
1111
<style>
1212
.AutoTest .row > div {
1313
text-align: center;
@@ -28,8 +28,8 @@
2828
</style>
2929
</head>
3030
<body>
31-
<script type="text/jsx;harmony=true">void function() {
32-
'use strict'
31+
<div id="app"></div>
32+
<script type="text/jsx;harmony=true">void function() { 'use strict';
3333

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

@@ -54,7 +54,7 @@
5454
}, 1000 + Math.random() * 1000)
5555
},
5656

57-
clean(cb) {
57+
clean: ['productName', 'vendor', function(cb) {
5858
var {productDescription} = this.cleanedData
5959
if (productDescription && productDescription.toLowerCase().indexOf('clowns') != -1) {
6060
throw forms.ValidationError('No clowns!')
@@ -70,7 +70,7 @@
7070
}
7171
cb(null)
7272
}, 1000 + Math.random() * 1000)
73-
}
73+
}]
7474
})
7575

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

299-
React.render(<App/>, document.body)
299+
React.render(<App/>, document.getElementById('app'))
300+
300301
}()</script>
301302
</body>

demo/index.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
<head>
33
<meta charset="UTF-8">
44
<title>The Form of Death | newforms-bootstrap</title>
5-
<script src="http://fb.me/react-with-addons-0.12.2.js"></script>
6-
<script src="http://fb.me/JSXTransformer-0.12.2.js"></script>
7-
<script src="../../newforms/build/newforms.js"></script>
5+
<script src="http://fb.me/react-0.13.0.js"></script>
6+
<script src="http://fb.me/JSXTransformer-0.13.0.js"></script>
7+
<script src="../../newforms/dist/newforms.js"></script>
88
<script src="../dist/newforms-bootstrap.js"></script>
99
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
1010
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
1111
</head>
1212
<body>
13-
<script type="text/jsx;harmony=true">void function() {
14-
'use strict'
13+
<div id="app"></div>
14+
<script type="text/jsx;harmony=true">void function() { 'use strict';
1515

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

142-
React.render(<App/>, document.body)
142+
React.render(<App/>, document.getElementById('app'))
143+
143144
}()</script>
144145
</body>

dist/newforms-bootstrap.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
/*!
2-
* newforms-bootstrap 1.1.1 - https://github.com/insin/newforms-bootstrap
2+
* newforms-bootstrap 2.0.0 - https://github.com/insin/newforms-bootstrap
33
* MIT Licensed
44
*/
5-
!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){
5+
(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){
66
'use strict';
77

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

1110
var $__0=
1211

@@ -437,7 +436,7 @@ var Container = React.createClass({displayName: "Container",
437436
formErrors.isPopulated() && React.createElement("div", {key: form.addPrefix('__all__'), className: "alert alert-danger has-error"},
438437
formErrors.messages().map(errorMessage)
439438
),
440-
React.Children.map(this.props.children, function(row, index) {return cloneWithProps(row, {
439+
React.Children.map(this.props.children, function(row, index) {return React.cloneElement(row, {
441440
autoColumns: this.props.autoColumns
442441
, form: this.props.form
443442
, index: index
@@ -470,7 +469,7 @@ var Row = React.createClass({displayName: "Row",
470469
}
471470
return React.createElement("div", {className: cx('row', this.props.className)},
472471
React.Children.map(this.props.children, function(child, index) {
473-
return cloneWithProps(child, extend({
472+
return React.cloneElement(child, extend({
474473
form: this.props.form
475474
, spinner: this.props.spinner
476475
}, columnProps[index]))

0 commit comments

Comments
 (0)