Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Update React from 16.0.0 to 16.1.1 #54

Merged
merged 3 commits into from
Nov 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions example/__tests__/__snapshots__/acceptance.js.snap
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Registry should correctly serve rendered and unrendered components 1`] = `"{\\"type\\":\\"oc-component-local\\",\\"version\\":\\"1.0.0\\",\\"requestVersion\\":\\"\\",\\"name\\":\\"react-app\\",\\"renderMode\\":\\"unrendered\\",\\"href\\":\\"http://localhost:3000/react-app?name=SuperMario\\",\\"data\\":{\\"reactComponent\\":{\\"key\\":\\"b7fe7d59ec6c94540b6f3015dc6f7c4740541d0c\\",\\"src\\":\\"http://localhost:3000/react-app/1.0.0/static/react-component.js\\",\\"props\\":{\\"name\\":\\"SuperMario\\",\\"staticPath\\":\\"http://localhost:3000/react-app/1.0.0/static/\\",\\"baseUrl\\":\\"http://localhost:3000/\\"}}},\\"template\\":{\\"src\\":\\"http://localhost:3000/react-app/1.0.0/static/template.js\\",\\"type\\":\\"oc-template-react\\",\\"key\\":\\"0633c8cf7bd05045e541620d85064180f21d7321\\"}}"`;
exports[`Registry should correctly serve rendered and unrendered components 1`] = `"{\\"type\\":\\"oc-component-local\\",\\"version\\":\\"1.0.0\\",\\"requestVersion\\":\\"\\",\\"name\\":\\"react-app\\",\\"renderMode\\":\\"unrendered\\",\\"href\\":\\"http://localhost:3000/react-app?name=SuperMario\\",\\"data\\":{\\"reactComponent\\":{\\"key\\":\\"b7fe7d59ec6c94540b6f3015dc6f7c4740541d0c\\",\\"src\\":\\"http://localhost:3000/react-app/1.0.0/static/react-component.js\\",\\"props\\":{\\"name\\":\\"SuperMario\\",\\"staticPath\\":\\"http://localhost:3000/react-app/1.0.0/static/\\",\\"baseUrl\\":\\"http://localhost:3000/\\"}}},\\"template\\":{\\"src\\":\\"http://localhost:3000/react-app/1.0.0/static/template.js\\",\\"type\\":\\"oc-template-react\\",\\"key\\":\\"1b0e2d10dfd2021949e8072206ea7ec52a7ec5ea\\"}}"`;

exports[`Registry should correctly serve rendered and unrendered components 2`] = `"{\\"type\\":\\"oc-component-local\\",\\"version\\":\\"1.0.0\\",\\"requestVersion\\":\\"\\",\\"name\\":\\"react-app\\",\\"renderMode\\":\\"rendered\\",\\"href\\":\\"http://localhost:3000/react-app?name=SuperMario\\",\\"html\\":\\"<oc-component href=\\\\\\"http://localhost:3000/react-app?name=SuperMario\\\\\\" data-hash=\\\\\\"0633c8cf7bd05045e541620d85064180f21d7321\\\\\\" data-name=\\\\\\"react-app\\\\\\" data-rendered=\\\\\\"true\\\\\\" data-version=\\\\\\"1.0.0\\\\\\"><div id=\\\\\\"oc-reactRoot-react-app\\\\\\" class=\\\\\\"oc-reactRoot-react-app\\\\\\" ><div class=\\\\\\"special__3K6pmcHx\\\\\\" data-reactroot=\\\\\\"\\\\\\"><h1>Hello <!-- -->SuperMario<!-- --> <!-- -->0</h1></div></div> <style>.special__3K6pmcHx{background:#db7093;color:#fff}</style> <script> window.oc = window.oc || {}; oc.cmd = oc.cmd || []; oc.cmd.push(function(oc){ oc.requireSeries([{\\\\\\"global\\\\\\":\\\\\\"React\\\\\\",\\\\\\"url\\\\\\":\\\\\\"https://unpkg.com/react@16.0.0/umd/react.production.min.js\\\\\\",\\\\\\"name\\\\\\":\\\\\\"react\\\\\\"},{\\\\\\"global\\\\\\":\\\\\\"ReactDOM\\\\\\",\\\\\\"url\\\\\\":\\\\\\"https://unpkg.com/react-dom@16.0.0/umd/react-dom.production.min.js\\\\\\",\\\\\\"name\\\\\\":\\\\\\"react-dom\\\\\\"}], function(){ oc.require( ['oc', 'reactComponents', 'b7fe7d59ec6c94540b6f3015dc6f7c4740541d0c'], 'http://localhost:3000/react-app/1.0.0/static/react-component.js', function(ReactComponent){ var targetNode = document.getElementById(\\\\\\"oc-reactRoot-react-app\\\\\\"); targetNode.setAttribute(\\\\\\"id\\\\\\",\\\\\\"\\\\\\"); ReactDOM.render(React.createElement(ReactComponent, {\\\\\\"name\\\\\\":\\\\\\"SuperMario\\\\\\",\\\\\\"staticPath\\\\\\":\\\\\\"http://localhost:3000/react-app/1.0.0/static/\\\\\\",\\\\\\"baseUrl\\\\\\":\\\\\\"http://localhost:3000/\\\\\\"}),targetNode); } ); }); }); </script> <script>window.oc=window.oc||{};oc.renderedComponents=oc.renderedComponents||{};oc.renderedComponents[\\\\\\"react-app\\\\\\"]=\\\\\\"1.0.0\\\\\\";</script></oc-component>\\"}"`;
exports[`Registry should correctly serve rendered and unrendered components 2`] = `"{\\"type\\":\\"oc-component-local\\",\\"version\\":\\"1.0.0\\",\\"requestVersion\\":\\"\\",\\"name\\":\\"react-app\\",\\"renderMode\\":\\"rendered\\",\\"href\\":\\"http://localhost:3000/react-app?name=SuperMario\\",\\"html\\":\\"<oc-component href=\\\\\\"http://localhost:3000/react-app?name=SuperMario\\\\\\" data-hash=\\\\\\"1b0e2d10dfd2021949e8072206ea7ec52a7ec5ea\\\\\\" data-name=\\\\\\"react-app\\\\\\" data-rendered=\\\\\\"true\\\\\\" data-version=\\\\\\"1.0.0\\\\\\"><div id=\\\\\\"oc-reactRoot-react-app\\\\\\" class=\\\\\\"oc-reactRoot-react-app\\\\\\" ><div class=\\\\\\"special__3K6pmcHx\\\\\\" data-reactroot=\\\\\\"\\\\\\"><h1>Hello <!-- -->SuperMario<!-- --> <!-- -->0</h1></div></div> <style>.special__3K6pmcHx{background:#db7093;color:#fff}</style> <script> window.oc = window.oc || {}; oc.cmd = oc.cmd || []; oc.cmd.push(function(oc){ oc.requireSeries([{\\\\\\"global\\\\\\":\\\\\\"React\\\\\\",\\\\\\"url\\\\\\":\\\\\\"https://unpkg.com/react@16.1.1/umd/react.production.min.js\\\\\\",\\\\\\"name\\\\\\":\\\\\\"react\\\\\\"},{\\\\\\"global\\\\\\":\\\\\\"ReactDOM\\\\\\",\\\\\\"url\\\\\\":\\\\\\"https://unpkg.com/react-dom@16.1.1/umd/react-dom.production.min.js\\\\\\",\\\\\\"name\\\\\\":\\\\\\"react-dom\\\\\\"}], function(){ oc.require( ['oc', 'reactComponents', 'b7fe7d59ec6c94540b6f3015dc6f7c4740541d0c'], 'http://localhost:3000/react-app/1.0.0/static/react-component.js', function(ReactComponent){ var targetNode = document.getElementById(\\\\\\"oc-reactRoot-react-app\\\\\\"); targetNode.setAttribute(\\\\\\"id\\\\\\",\\\\\\"\\\\\\"); ReactDOM.render(React.createElement(ReactComponent, {\\\\\\"name\\\\\\":\\\\\\"SuperMario\\\\\\",\\\\\\"staticPath\\\\\\":\\\\\\"http://localhost:3000/react-app/1.0.0/static/\\\\\\",\\\\\\"baseUrl\\\\\\":\\\\\\"http://localhost:3000/\\\\\\"}),targetNode); } ); }); }); </script> <script>window.oc=window.oc||{};oc.renderedComponents=oc.renderedComponents||{};oc.renderedComponents[\\\\\\"react-app\\\\\\"]=\\\\\\"1.0.0\\\\\\";</script></oc-component>\\"}"`;

exports[`server-side-side rendering 1`] = `
"<!DOCTYPE html><html><head>
<title>A page</title>
</head>
<body>
<oc-component href=\\"http://localhost:3000/react-app?name=SuperMario\\" data-hash=\\"0633c8cf7bd05045e541620d85064180f21d7321\\" data-name=\\"react-app\\" data-rendered=\\"true\\" data-version=\\"1.0.0\\"><div id=\\"oc-reactRoot-react-app\\" class=\\"oc-reactRoot-react-app\\"><div class=\\"special__3K6pmcHx\\" data-reactroot=\\"\\"><h1>Hello <!-- -->SuperMario<!-- --> <!-- -->0</h1></div></div> <style>.special__3K6pmcHx{background:#db7093;color:#fff}</style> <script> window.oc = window.oc || {}; oc.cmd = oc.cmd || []; oc.cmd.push(function(oc){ oc.requireSeries([{\\"global\\":\\"React\\",\\"url\\":\\"https://unpkg.com/react@16.0.0/umd/react.production.min.js\\",\\"name\\":\\"react\\"},{\\"global\\":\\"ReactDOM\\",\\"url\\":\\"https://unpkg.com/react-dom@16.0.0/umd/react-dom.production.min.js\\",\\"name\\":\\"react-dom\\"}], function(){ oc.require( ['oc', 'reactComponents', 'b7fe7d59ec6c94540b6f3015dc6f7c4740541d0c'], 'http://localhost:3000/react-app/1.0.0/static/react-component.js', function(ReactComponent){ var targetNode = document.getElementById(\\"oc-reactRoot-react-app\\"); targetNode.setAttribute(\\"id\\",\\"\\"); ReactDOM.render(React.createElement(ReactComponent, {\\"name\\":\\"SuperMario\\",\\"staticPath\\":\\"http://localhost:3000/react-app/1.0.0/static/\\",\\"baseUrl\\":\\"http://localhost:3000/\\"}),targetNode); } ); }); }); </script> <script>window.oc=window.oc||{};oc.renderedComponents=oc.renderedComponents||{};oc.renderedComponents[\\"react-app\\"]=\\"1.0.0\\";</script></oc-component>
<oc-component href=\\"http://localhost:3000/react-app?name=SuperMario\\" data-hash=\\"1b0e2d10dfd2021949e8072206ea7ec52a7ec5ea\\" data-name=\\"react-app\\" data-rendered=\\"true\\" data-version=\\"1.0.0\\"><div id=\\"oc-reactRoot-react-app\\" class=\\"oc-reactRoot-react-app\\"><div class=\\"special__3K6pmcHx\\" data-reactroot=\\"\\"><h1>Hello <!-- -->SuperMario<!-- --> <!-- -->0</h1></div></div> <style>.special__3K6pmcHx{background:#db7093;color:#fff}</style> <script> window.oc = window.oc || {}; oc.cmd = oc.cmd || []; oc.cmd.push(function(oc){ oc.requireSeries([{\\"global\\":\\"React\\",\\"url\\":\\"https://unpkg.com/react@16.1.1/umd/react.production.min.js\\",\\"name\\":\\"react\\"},{\\"global\\":\\"ReactDOM\\",\\"url\\":\\"https://unpkg.com/react-dom@16.1.1/umd/react-dom.production.min.js\\",\\"name\\":\\"react-dom\\"}], function(){ oc.require( ['oc', 'reactComponents', 'b7fe7d59ec6c94540b6f3015dc6f7c4740541d0c'], 'http://localhost:3000/react-app/1.0.0/static/react-component.js', function(ReactComponent){ var targetNode = document.getElementById(\\"oc-reactRoot-react-app\\"); targetNode.setAttribute(\\"id\\",\\"\\"); ReactDOM.render(React.createElement(ReactComponent, {\\"name\\":\\"SuperMario\\",\\"staticPath\\":\\"http://localhost:3000/react-app/1.0.0/static/\\",\\"baseUrl\\":\\"http://localhost:3000/\\"}),targetNode); } ); }); }); </script> <script>window.oc=window.oc||{};oc.renderedComponents=oc.renderedComponents||{};oc.renderedComponents[\\"react-app\\"]=\\"1.0.0\\";</script></oc-component>
<script>window.oc = window.oc || {};
oc.conf = oc.conf || {};
oc.conf.templates = oc.conf.templates || [];
oc.conf.templates = oc.conf.templates.concat([{\\"type\\":\\"oc-template-jade\\",\\"version\\":\\"6.0.9\\",\\"externals\\":[{\\"global\\":\\"jade\\",\\"url\\":\\"https://unpkg.com/jade-legacy@1.11.1/runtime.js\\",\\"name\\":\\"jade\\"}]},{\\"type\\":\\"oc-template-handlebars\\",\\"version\\":\\"6.0.8\\",\\"externals\\":[{\\"global\\":\\"Handlebars\\",\\"url\\":\\"https://unpkg.com/handlebars@4.0.11/dist/handlebars.runtime.min.js\\",\\"name\\":\\"handlebars\\"}]},{\\"type\\":\\"oc-template-react\\",\\"version\\":\\"1.0.1\\",\\"externals\\":[{\\"global\\":\\"React\\",\\"url\\":\\"https://unpkg.com/react@16.0.0/umd/react.production.min.js\\",\\"name\\":\\"react\\"},{\\"global\\":\\"ReactDOM\\",\\"url\\":\\"https://unpkg.com/react-dom@16.0.0/umd/react-dom.production.min.js\\",\\"name\\":\\"react-dom\\"}]}]);</script><script src=\\"http://localhost:3000/oc-client/0.41.14/static/src/oc-client.min.js\\" type=\\"text/javascript\\"></script><script>window.oc=window.oc||{};oc.renderedComponents=oc.renderedComponents||{};oc.renderedComponents[\\"oc-client\\"]=\\"0.41.14\\";</script>
oc.conf.templates = oc.conf.templates.concat([{\\"type\\":\\"oc-template-jade\\",\\"version\\":\\"6.0.9\\",\\"externals\\":[{\\"global\\":\\"jade\\",\\"url\\":\\"https://unpkg.com/jade-legacy@1.11.1/runtime.js\\",\\"name\\":\\"jade\\"}]},{\\"type\\":\\"oc-template-handlebars\\",\\"version\\":\\"6.0.8\\",\\"externals\\":[{\\"global\\":\\"Handlebars\\",\\"url\\":\\"https://unpkg.com/handlebars@4.0.11/dist/handlebars.runtime.min.js\\",\\"name\\":\\"handlebars\\"}]},{\\"type\\":\\"oc-template-react\\",\\"version\\":\\"1.0.1\\",\\"externals\\":[{\\"global\\":\\"React\\",\\"url\\":\\"https://unpkg.com/react@16.1.1/umd/react.production.min.js\\",\\"name\\":\\"react\\"},{\\"global\\":\\"ReactDOM\\",\\"url\\":\\"https://unpkg.com/react-dom@16.1.1/umd/react-dom.production.min.js\\",\\"name\\":\\"react-dom\\"}]}]);</script><script src=\\"http://localhost:3000/oc-client/0.41.14/static/src/oc-client.min.js\\" type=\\"text/javascript\\"></script><script>window.oc=window.oc||{};oc.renderedComponents=oc.renderedComponents||{};oc.renderedComponents[\\"oc-client\\"]=\\"0.41.14\\";</script>


</body></html>"
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"request-promise-native": "^1.0.5"
},
"dependencies": {
"oc-template-react-compiler": "../packages/oc-template-react-compiler"
"oc-template-react-compiler": "1.0.6"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Object {
"hashKey": "9226c0643c9b97f8cbe8fcfd3cf8d343b8d88eba",
},
"template": Object {
"hashKey": "e8e90668846b099b79959952801569f553324780",
"hashKey": "f3981e9352bc88d85a6e66c26f7db0f7de6f2cd9",
"src": "template.js",
"type": "oc-template-react",
},
}
`;

exports[`Should correctly compile the view 2`] = `"var oc=oc||{};oc.components=oc.components||{};oc.components['e8e90668846b099b79959952801569f553324780']=function(model){ return \`<div id=\\"oc-reactRoot-react-component\\" class=\\"oc-reactRoot-react-component\\" >\${ model.__html ? model.__html : '' }</div> <style>null</style> <script> window.oc = window.oc || {}; oc.cmd = oc.cmd || []; oc.cmd.push(function(oc){ oc.requireSeries([{\\"global\\":\\"React\\",\\"url\\":\\"https://unpkg.com/react@16.0.0/umd/react.production.min.js\\",\\"name\\":\\"react\\"},{\\"global\\":\\"ReactDOM\\",\\"url\\":\\"https://unpkg.com/react-dom@16.0.0/umd/react-dom.production.min.js\\",\\"name\\":\\"react-dom\\"}], function(){ oc.require( ['oc', 'reactComponents', '9226c0643c9b97f8cbe8fcfd3cf8d343b8d88eba'], '\${model.reactComponent.props.staticPath}react-component.js', function(ReactComponent){ var targetNode = document.getElementById(\\"oc-reactRoot-react-component\\"); targetNode.setAttribute(\\"id\\",\\"\\"); ReactDOM.render(React.createElement(ReactComponent, \${JSON.stringify(model.reactComponent.props)}),targetNode); } ); }); }); </script> \`; }"`;
exports[`Should correctly compile the view 2`] = `"var oc=oc||{};oc.components=oc.components||{};oc.components['f3981e9352bc88d85a6e66c26f7db0f7de6f2cd9']=function(model){ return \`<div id=\\"oc-reactRoot-react-component\\" class=\\"oc-reactRoot-react-component\\" >\${ model.__html ? model.__html : '' }</div> <style>null</style> <script> window.oc = window.oc || {}; oc.cmd = oc.cmd || []; oc.cmd.push(function(oc){ oc.requireSeries([{\\"global\\":\\"React\\",\\"url\\":\\"https://unpkg.com/react@16.1.1/umd/react.production.min.js\\",\\"name\\":\\"react\\"},{\\"global\\":\\"ReactDOM\\",\\"url\\":\\"https://unpkg.com/react-dom@16.1.1/umd/react-dom.production.min.js\\",\\"name\\":\\"react-dom\\"}], function(){ oc.require( ['oc', 'reactComponents', '9226c0643c9b97f8cbe8fcfd3cf8d343b8d88eba'], '\${model.reactComponent.props.staticPath}react-component.js', function(ReactComponent){ var targetNode = document.getElementById(\\"oc-reactRoot-react-component\\"); targetNode.setAttribute(\\"id\\",\\"\\"); ReactDOM.render(React.createElement(ReactComponent, \${JSON.stringify(model.reactComponent.props)}),targetNode); } ); }); }); </script> \`; }"`;
2 changes: 1 addition & 1 deletion packages/oc-template-react-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"oc-templates-messages": "1.0.1",
"oc-view-wrapper": "1.0.2",
"oc-webpack": "2.1.1",
"react": "16.0.0",
"react": "16.1.1",
"webpack": "^3.5.5"
},
"files": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Object {
Object {
"global": "React",
"name": "react",
"url": "https://unpkg.com/react@16.0.0/umd/react.production.min.js",
"url": "https://unpkg.com/react@16.1.1/umd/react.production.min.js",
},
Object {
"global": "ReactDOM",
"name": "react-dom",
"url": "https://unpkg.com/react-dom@16.0.0/umd/react-dom.production.min.js",
"url": "https://unpkg.com/react-dom@16.1.1/umd/react-dom.production.min.js",
},
],
"type": "oc-template-react",
Expand Down
8 changes: 4 additions & 4 deletions packages/oc-template-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"minimal-request": "^2.2.0",
"nice-cache": "0.0.5",
"oc-generic-template-renderer": "2.0.1",
"react": "16.0.0",
"react-dom": "16.0.0"
"react": "16.1.1",
"react-dom": "16.1.1"
},
"files": [
"lib",
Expand All @@ -38,11 +38,11 @@
"externals": {
"react": {
"global": "React",
"url": "https://unpkg.com/react@16.0.0/umd/react.production.min.js"
"url": "https://unpkg.com/react@16.1.1/umd/react.production.min.js"
},
"react-dom": {
"global": "ReactDOM",
"url": "https://unpkg.com/react-dom@16.0.0/umd/react-dom.production.min.js"
"url": "https://unpkg.com/react-dom@16.1.1/umd/react-dom.production.min.js"
}
}
}