diff --git a/.flowconfig b/.flowconfig index a4493837b7..453cebbcda 100644 --- a/.flowconfig +++ b/.flowconfig @@ -6,7 +6,6 @@ .*/node_modules/styled-components/.* .*/node_modules/graphql/.* .*/node_modules/metro.* -.*/node_modules/preact/.* .*/node_modules/@parcel/.* [untyped] diff --git a/.flowconfig-ci b/.flowconfig-ci index 97256ad2e7..599ace2fc3 100644 --- a/.flowconfig-ci +++ b/.flowconfig-ci @@ -6,7 +6,6 @@ .*/node_modules/styled-components/.* .*/node_modules/graphql/.* .*/node_modules/metro.* -.*/node_modules/preact/.* .*/node_modules/@parcel/.* diff --git a/packages/is-prop-valid/src/props.js b/packages/is-prop-valid/src/props.js index f82355efd6..664de71e53 100644 --- a/packages/is-prop-valid/src/props.js +++ b/packages/is-prop-valid/src/props.js @@ -481,7 +481,10 @@ const props = { yChannelSelector: true, z: true, zoomAndPan: true, - // preact + + // For preact. We have this code here even though Emotion doesn't support + // Preact, since @emotion/is-prop-valid is used by some libraries outside of + // the context of Emotion. for: true, class: true, autofocus: true diff --git a/packages/jest/package.json b/packages/jest/package.json index eb3b3484f5..dca95d2966 100644 --- a/packages/jest/package.json +++ b/packages/jest/package.json @@ -41,8 +41,6 @@ "@emotion/react": "11.9.0", "@types/jest": "^27.0.3", "enzyme-to-json": "^3.6.1", - "preact": "^8.2.9", - "preact-render-to-json": "^3.6.6", "pretty-format": "^22.4.3", "react": "16.14.0", "react-dom": "16.14.0", diff --git a/packages/jest/test/__snapshots__/preact.test.js.snap b/packages/jest/test/__snapshots__/preact.test.js.snap deleted file mode 100644 index 0d86245d12..0000000000 --- a/packages/jest/test/__snapshots__/preact.test.js.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`jest-emotion with preact handles elements with no props 1`] = `"
"`; - -exports[`jest-emotion with preact replaces class names and inserts styles into preact test component snapshots 1`] = ` -".emotion-0 { - color: red; -} - -.emotion-1 { - width: 100%; -} - -
- -
" -`; diff --git a/packages/jest/test/preact.test.js b/packages/jest/test/preact.test.js deleted file mode 100644 index 70bd010cb8..0000000000 --- a/packages/jest/test/preact.test.js +++ /dev/null @@ -1,44 +0,0 @@ -/* eslint-disable react/no-unknown-property */ -import 'test-utils/legacy-env' -/** @jsx h */ -import { h } from 'preact' -import render from 'preact-render-to-json' -import prettyFormat from 'pretty-format' -import * as emotion from '@emotion/css' -import { createSerializer } from '@emotion/jest' -const { ReactElement, ReactTestComponent, DOMElement } = prettyFormat.plugins - -let emotionPlugin = createSerializer() - -describe('jest-emotion with preact', () => { - const divStyle = emotion.css` - color: red; - ` - const svgStyle = emotion.css` - width: 100%; - ` - - it('replaces class names and inserts styles into preact test component snapshots', () => { - const tree = render( -
- -
- ) - - const output = prettyFormat(tree, { - plugins: [emotionPlugin, ReactElement, ReactTestComponent, DOMElement] - }) - - expect(output).toMatchSnapshot() - }) - - it('handles elements with no props', () => { - const tree = render(
) - - const output = prettyFormat(tree, { - plugins: [emotionPlugin, ReactElement, ReactTestComponent, DOMElement] - }) - - expect(output).toMatchSnapshot() - }) -}) diff --git a/yarn.lock b/yarn.lock index 57b85a09e9..0406c4edca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -24724,16 +24724,6 @@ potrace@^2.1.8: dependencies: jimp "^0.14.0" -preact-render-to-json@^3.6.6: - version "3.6.6" - resolved "https://registry.npmjs.org/preact-render-to-json/-/preact-render-to-json-3.6.6.tgz#f67f48581912ac53fc9f4873bc6d7ce342f71c20" - integrity sha1-9n9IWBkSrFP8n0hzvG1840L3HCA= - -preact@^8.2.9: - version "8.5.0" - resolved "https://registry.npmjs.org/preact/-/preact-8.5.0.tgz#05690de3af035cd8ad393e8b4057b8ab29aedee1" - integrity sha512-S2OOz+lRjfbqDbV5LOIcJ6yfYvshDtKvvsMwaFW84wuw4HtFUYH67T+hnWhdCDYtW8BfmyIg9utz16s6U80HbA== - prebuild-install@^6.0.1: version "6.1.4" resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-6.1.4.tgz#ae3c0142ad611d58570b89af4986088a4937e00f"