Linus Falck-Ytter
Boston Code Camp, April 7th, 2018
Software Developer @ MIT Sloan
@lifayt
slides.com/lifayt
github.com/lifayt
Content Editor:
Script Editor:
Content Editor:
Script Editor:
SharePoint Document Library:
Deployed Solution:
SharePoint Document
Library:
Deployed Solution:
SharePoint Encourages:
Modern JavaScript development mostly happens in a local development environment, with tooling to help the build and development process
class Counter extends React.Component {
state = {
count: 0
}
handleIncrement = () => {
this.setState((prevState, props) => {
return ({ count: prevState.count + 1 });
})
}
handleDecrement = () => {
this.setState((prevState, props) => {
return ({ count: prevState.count - 1 });
})
}
render() {
return (
<div className='counter-app'>
<div className='counter'> {this.state.count} </div>
<button className='counter button' type='button' onClick={this.handleIncrement}>
increment
</button>
<button className='counter button' type='button' onClick={this.handleDecrement}>
decrement
</button>
</div>
);
}
}
ReactDOM.render(
<Counter />,
document.getElementById("root")
);
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) {if (window.CP.shouldStopExecution(1)){break;} var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); }
window.CP.exitedLoop(1);
} return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Counter = function (_React$Component) {
_inherits(Counter, _React$Component);
function Counter() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Counter);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {if (window.CP.shouldStopExecution(2)){break;}
args[_key] = arguments[_key];
}
window.CP.exitedLoop(2);
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Counter.__proto__ || Object.getPrototypeOf(Counter)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
count: 0
}, _this.handleIncrement = function () {
_this.setState(function (prevState, props) {
return { count: prevState.count + 1 };
});
}, _this.handleDecrement = function () {
_this.setState(function (prevState, props) {
return { count: prevState.count - 1 };
});
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Counter, [{
key: 'render',
value: function render() {
return React.createElement(
'div',
{ className: 'counter-app' },
React.createElement(
'div',
{ className: 'counter' },
' ',
this.state.count,
' '
),
React.createElement(
'button',
{ className: 'counter button', type: 'button', onClick: this.handleIncrement },
'increment'
),
React.createElement(
'button',
{ className: 'counter button', type: 'button', onClick: this.handleDecrement },
'decrement'
)
);
}
}]);
return Counter;
}(React.Component);
ReactDOM.render(React.createElement(Counter, null), document.getElementById("root"));
Worth it if:
Issues: Very Abstracted System
Providing Externals:
Opinionated Build Additions:
Opinionated Build Additions:
Opinionated Build Additions:
Optimized for a single page application:
Bless this guy
Do you do weird stuff like Forms Authentication? This guy has got your back!
Insert automated deployment into your workflow anywhere:
Insert automated deployment into your workflow anywhere:
Still getting weird.
The 'Useful' Zone
SharePoint Framework ...x
SharePoint Online
SharePoint On Premises
Good When
Good When