Skip to content

Commit

Permalink
Revert "Framework: update to React 16, try 2" (Automattic#19609)
Browse files Browse the repository at this point in the history
* Revert "i18n-calypso: upgrade i18n-calypso for React 16 compat (Automattic#19358) take2 (Automattic#19366)"

This reverts commit 6da8ec1.

* Revert "Remove code to recommend shortest domain name for A/B Test. (Automattic#19536)"

This reverts commit 0d1938d.

* Revert "Framework: update to React 16, try 2 (Automattic#19571)"

This reverts commit 4328a23.
  • Loading branch information
samouri authored Nov 8, 2017
1 parent c31fb10 commit 577331f
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 43 deletions.
2 changes: 1 addition & 1 deletion client/components/root-child/test/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe( 'RootChild', () => {
var tree = mount( React.createElement( Greeting ), { attachTo: container } );
tree.setProps( { toWhom: 'Universe' } );

expect( tree.ref( 'rootChild' ).innerHTML ).to.equal( 'Hello Universe!' );
expect( tree.ref( 'rootChild' ).textContent ).to.equal( 'Hello Universe!' );
tree.detach();
} );
} );
Expand Down
9 changes: 5 additions & 4 deletions client/lib/embed-frame-markup/test/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/** @format */

/* eslint-disable max-len */

/**
* External dependencies
*/
Expand All @@ -10,15 +12,14 @@ import { expect } from 'chai';
*/
import generateEmbedFrameMarkup from '../';

/* eslint-disable max-len */
describe( '#generateEmbedFrameMarkup()', () => {
test( 'should return an empty string if no arguments passed', () => {
expect( generateEmbedFrameMarkup() ).to.equal( '' );
} );

test( 'should generate markup with the body contents', () => {
expect( generateEmbedFrameMarkup( { body: 'Hello World' } ) ).to.equal(
'<html><head><style>a { cursor: default; }</style></head><body style="margin:0"><div>Hello World</div><script src="https://s0.wp.com/wp-includes/js/jquery/jquery.js"></script><script>\n\t\t\t\t\t[ \'click\', \'dragstart\' ].forEach( function( type ) {\n\t\t\t\t\t\tdocument.addEventListener( type, function( event ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\t}, true );\n\t\t\t\t\t} );\n\t\t\t\t</script></body></html>'
'<html><head><style>a { cursor: default; }</style></head><body style="margin:0;"><div>Hello World</div><script src="https://s0.wp.com/wp-includes/js/jquery/jquery.js"></script><script>\n\t\t\t\t\t[ \'click\', \'dragstart\' ].forEach( function( type ) {\n\t\t\t\t\t\tdocument.addEventListener( type, function( event ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\t}, true );\n\t\t\t\t\t} );\n\t\t\t\t</script></body></html>'
);
} );

Expand All @@ -32,7 +33,7 @@ describe( '#generateEmbedFrameMarkup()', () => {
};

expect( generateEmbedFrameMarkup( { styles } ) ).to.equal(
'<html><head><link rel="stylesheet" media="all" href="https://s1.wp.com/wp-content/mu-plugins/carousel/jetpack-carousel.css?m=1458924076h&amp;ver=20120629"/><style>a { cursor: default; }</style></head><body style="margin:0"><div></div><script src="https://s0.wp.com/wp-includes/js/jquery/jquery.js"></script><script>\n\t\t\t\t\t[ \'click\', \'dragstart\' ].forEach( function( type ) {\n\t\t\t\t\t\tdocument.addEventListener( type, function( event ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\t}, true );\n\t\t\t\t\t} );\n\t\t\t\t</script></body></html>'
'<html><head><link rel="stylesheet" media="all" href="https://s1.wp.com/wp-content/mu-plugins/carousel/jetpack-carousel.css?m=1458924076h&amp;ver=20120629"/><style>a { cursor: default; }</style></head><body style="margin:0;"><div></div><script src="https://s0.wp.com/wp-includes/js/jquery/jquery.js"></script><script>\n\t\t\t\t\t[ \'click\', \'dragstart\' ].forEach( function( type ) {\n\t\t\t\t\t\tdocument.addEventListener( type, function( event ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\t}, true );\n\t\t\t\t\t} );\n\t\t\t\t</script></body></html>'
);
} );

Expand All @@ -45,7 +46,7 @@ describe( '#generateEmbedFrameMarkup()', () => {
};

expect( generateEmbedFrameMarkup( { scripts } ) ).to.equal(
'<html><head><style>a { cursor: default; }</style></head><body style="margin:0"><div></div><script src="https://s0.wp.com/wp-includes/js/jquery/jquery.js"></script><script>\n\t\t\t\t\t[ \'click\', \'dragstart\' ].forEach( function( type ) {\n\t\t\t\t\t\tdocument.addEventListener( type, function( event ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\t}, true );\n\t\t\t\t\t} );\n\t\t\t\t</script><script>var jpfbembed = {"appid":"249643311490"};</script><script src="https://s2.wp.com/wp-content/mu-plugins/shortcodes/js/facebook.js?ver"></script></body></html>'
'<html><head><style>a { cursor: default; }</style></head><body style="margin:0;"><div></div><script src="https://s0.wp.com/wp-includes/js/jquery/jquery.js"></script><script>\n\t\t\t\t\t[ \'click\', \'dragstart\' ].forEach( function( type ) {\n\t\t\t\t\t\tdocument.addEventListener( type, function( event ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\t}, true );\n\t\t\t\t\t} );\n\t\t\t\t</script><script>var jpfbembed = {"appid":"249643311490"};</script><script src="https://s2.wp.com/wp-content/mu-plugins/shortcodes/js/facebook.js?ver"></script></body></html>'
);
} );
} );
2 changes: 1 addition & 1 deletion client/post-editor/media-modal/markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Markup = {
parsed.attrs.named.align,
parsed.attrs.named.classes
) }
style={ { width: parseInt( width, 10 ) } }
style={ { width: width } }
>
<dt className="wp-caption-dt" dangerouslySetInnerHTML={ { __html: img } } />
<dd className="wp-caption-dd">{ caption }</dd>
Expand Down
4 changes: 2 additions & 2 deletions client/post-editor/media-modal/test/markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe( 'markup', () => {

expect( value.type ).to.equal( 'dl' );
expect( ReactDomServer.renderToStaticMarkup( value ) ).to.equal(
'<dl class="wp-caption" style="width:276px"><dt class="wp-caption-dt"><img src="https://s1.wp.com/wp-content/themes/a8c/automattic-2011/images/automattic-logo.png" alt="Automattic" width="276" class="alignnone size-full wp-image-1"/></dt><dd class="wp-caption-dd">Logo</dd></dl>'
'<dl class="wp-caption" style="width:276px;"><dt class="wp-caption-dt"><img src="https://s1.wp.com/wp-content/themes/a8c/automattic-2011/images/automattic-logo.png" alt="Automattic" width="276" class="alignnone size-full wp-image-1"/></dt><dd class="wp-caption-dd">Logo</dd></dl>'
);
} );

Expand All @@ -104,7 +104,7 @@ describe( 'markup', () => {

expect( value.type ).to.equal( 'dl' );
expect( ReactDomServer.renderToStaticMarkup( value ) ).to.equal(
'<dl class="wp-caption aligncenter" style="width:660px"><dt class="wp-caption-dt"><img class="size-full wp-image-1627" src="https://andrewmduthietest.files.wordpress.com/2015/01/img_0372.jpg" alt="Example" width="660" height="660" /></dt><dd class="wp-caption-dd">Ceramic</dd></dl>'
'<dl class="wp-caption aligncenter" style="width:660px;"><dt class="wp-caption-dt"><img class="size-full wp-image-1627" src="https://andrewmduthietest.files.wordpress.com/2015/01/img_0372.jpg" alt="Example" width="660" height="660" /></dt><dd class="wp-caption-dd">Ceramic</dd></dl>'
);
} );
} );
Expand Down
35 changes: 7 additions & 28 deletions npm-shrinkwrap.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"ms": "0.7.1",
"name-all-modules-plugin": "1.0.1",
"node-sass": "4.5.3",
"notifications-panel": "2.0.0",
"notifications-panel": "1.2.7",
"npm-run-all": "4.0.2",
"numeral": "2.0.4",
"page": "1.6.4",
Expand All @@ -121,10 +121,10 @@
"q": "1.0.1",
"qrcode.react": "0.7.2",
"qs": "4.0.0",
"react": "16.0.0",
"react": "15.6.2",
"react-click-outside": "2.3.1",
"react-day-picker": "6.2.1",
"react-dom": "16.0.0",
"react-dom": "15.6.2",
"react-hot-loader": "1.3.1",
"react-modal": "3.1.0",
"react-pure-render": "1.0.2",
Expand Down Expand Up @@ -246,7 +246,7 @@
"chai-enzyme": "1.0.0-beta.0",
"deep-freeze": "0.0.1",
"enzyme": "3.1.0",
"enzyme-adapter-react-16": "1.0.4",
"enzyme-adapter-react-15": "1.0.3",
"enzyme-to-json": "3.1.4",
"esformatter": "0.7.3",
"esformatter-braces": "1.2.1",
Expand Down Expand Up @@ -276,7 +276,7 @@
"prettier": "github:automattic/calypso-prettier#717e62ee",
"pretty-bytes": "4.0.2",
"react-codemod": "reactjs/react-codemod",
"react-test-renderer": "16.0.0",
"react-test-renderer": "15.6.2",
"readline-sync": "1.4.5",
"sinon": "1.17.7",
"sinon-chai": "2.8.0",
Expand Down
2 changes: 1 addition & 1 deletion test/client/setup-test-framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jest.mock( 'enzyme', () => {
chai.use( chaiEnzyme() );

// configure enzyme 3 for React, from docs: http://airbnb.io/enzyme/docs/installation/index.html
const Adapter = require.requireActual( 'enzyme-adapter-react-16' );
const Adapter = require.requireActual( 'enzyme-adapter-react-15' );
actualEnzyme.configure( { adapter: new Adapter() } );

// configure snapshot serializer for enzyme
Expand Down
3 changes: 2 additions & 1 deletion webpack.config.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ function getExternals() {
externals[ 'bundler/assets' ] = 'commonjs bundler/assets';
// Map React and redux to the minimized version in production
if ( config( 'env' ) === 'production' ) {
externals.react = 'commonjs react/umd/react.production.min.js';
externals[ 'react-with-addons' ] = 'commonjs react/dist/react-with-addons.min';
externals.react = 'commonjs react/dist/react.min';
externals.redux = 'commonjs redux/dist/redux.min';
}

Expand Down

0 comments on commit 577331f

Please sign in to comment.