Skip to content

Commit

Permalink
Upgrade flow (emotion-js#1566)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist authored and emmatown committed Oct 23, 2019
1 parent 2425d03 commit a4d40aa
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[version]
0.89.0
0.110.0

[ignore]
.*/node_modules/config-chain/.*
Expand All @@ -23,4 +23,4 @@

[options]
suppress_comment=.*\\$FlowFixMe
sharedmemory.hash_table_pow=21
sharedmemory.hash_table_pow=21
2 changes: 1 addition & 1 deletion .flowconfig-ci
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[version]
0.89.0
0.110.0

[ignore]
.*/node_modules/config-chain/.*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
"eslint-plugin-react": "^7.3.0",
"eslint-plugin-react-hooks": "^1.0.1",
"eslint-plugin-standard": "^3.0.1",
"flow-bin": "^0.89.0",
"flow-bin": "^0.110.0",
"html-tag-names": "^1.1.2",
"husky": "^1.1.3",
"jest": "^24.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/__tests__/warnings.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ test('kebab-case', () => {
css({ '@media (min-width 800px)': undefined })
css({ '--primary-color': 'hotpink' })
css({ ':last-of-type': null })
expect(console.error.mock.calls).toMatchInlineSnapshot(`
expect((console.error: any).mock.calls).toMatchInlineSnapshot(`
Array [
Array [
"Using kebab-case for css properties in objects is not supported. Did you mean backgroundColor?",
Expand Down Expand Up @@ -225,7 +225,7 @@ test('keyframes interpolated into plain string', () => {
renderer.create(
<div css={[`animation: ${animateColor} 10s ${rotate360} 5s;`]} />
)
expect(console.error.mock.calls).toMatchInlineSnapshot(`
expect((console.error: any).mock.calls).toMatchInlineSnapshot(`
Array [
Array [
"\`keyframes\` output got interpolated into plain string, please wrap it with \`css\`.
Expand Down
2 changes: 1 addition & 1 deletion packages/emotion-server/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('extractCritical', () => {
)
)

expect(console.error.mock.calls).toMatchObject([])
expect((console.error: any).mock.calls).toMatchObject([])
})
})
})
Expand Down
4 changes: 2 additions & 2 deletions packages/emotion/test/no-babel/warnings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ it('warns about illegal escape sequences inside first quasi of template literal'
}
`

expect(console.error.mock.calls[0]).toMatchInlineSnapshot(`
expect((console.error: any).mock.calls[0]).toMatchInlineSnapshot(`
Array [
"You have illegal escape sequence in your template literal, most likely inside content's property value.
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\"content: '\\\\00d7';\\" should become \\"content: '\\\\\\\\00d7';\\".
Expand All @@ -36,7 +36,7 @@ it('warns about illegal escape sequences inside non-first quasi of template lite
}
`

expect(console.error.mock.calls[0]).toMatchInlineSnapshot(`
expect((console.error: any).mock.calls[0]).toMatchInlineSnapshot(`
Array [
"You have illegal escape sequence in your template literal, most likely inside content's property value.
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\"content: '\\\\00d7';\\" should become \\"content: '\\\\\\\\00d7';\\".
Expand Down
2 changes: 1 addition & 1 deletion packages/emotion/test/warnings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ it('warns when class names from css are interpolated', () => {
color: hotpink;
}
`
expect(console.error.mock.calls[0]).toMatchInlineSnapshot(`
expect((console.error: any).mock.calls[0]).toMatchInlineSnapshot(`
Array [
"Interpolating a className from css\`\` is not recommended and will cause problems with composition.
Interpolating a className from css\`\` will be completely unsupported in a future major version of Emotion",
Expand Down
1 change: 1 addition & 0 deletions packages/serialize/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ export const serializeStyles = function(
let name = hashString(styles) + identifierName

if (process.env.NODE_ENV !== 'production') {
// $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)
return {
name,
styles,
Expand Down
2 changes: 1 addition & 1 deletion packages/sheet/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('StyleSheet', () => {
console.warn = jest.fn()
sheet.insert('.asdfasdf4###112121211{')
expect(console.warn).toHaveBeenCalledTimes(1)
expect(console.warn.mock.calls[0][0]).toBe(
expect((console.warn: any).mock.calls[0][0]).toBe(
'There was a problem inserting the following rule: ".asdfasdf4###112121211{"'
)
// $FlowFixMe
Expand Down
6 changes: 3 additions & 3 deletions packages/styled/__tests__/styled-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test('innerRef', () => {
</H1>
)
expect(node).toBe(document.getElementById('thing'))
expect(console.error.mock.calls).toMatchInlineSnapshot(`
expect((console.error: any).mock.calls).toMatchInlineSnapshot(`
Array [
Array [
"\`innerRef\` is deprecated and will be removed in a future major version of Emotion, please use the \`ref\` prop instead",
Expand All @@ -68,7 +68,7 @@ test('innerRef and ref', () => {
)
expect(ref.current).toBe(document.getElementById('thing'))
expect(innerRef.current).toBeNull()
expect(console.error.mock.calls).toMatchInlineSnapshot(`
expect((console.error: any).mock.calls).toMatchInlineSnapshot(`
Array [
Array [
"\`innerRef\` is deprecated and will be removed in a future major version of Emotion, please use the \`ref\` prop instead",
Expand Down Expand Up @@ -96,7 +96,7 @@ test('innerRef warning with label', () => {
</H1>
)
expect(node).toBe(document.getElementById('thing'))
expect(console.error.mock.calls).toMatchInlineSnapshot(`
expect((console.error: any).mock.calls).toMatchInlineSnapshot(`
Array [
Array [
"\`innerRef\` is deprecated and will be removed in a future major version of Emotion, please use the \`ref\` prop instead in the usage of \`H1\`",
Expand Down
4 changes: 2 additions & 2 deletions packages/styled/__tests__/warnings.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ it('warns about illegal escape sequences inside first quasi of template literal'
}
`

expect(console.error.mock.calls[0]).toMatchInlineSnapshot(`
expect((console.error: any).mock.calls[0]).toMatchInlineSnapshot(`
Array [
"You have illegal escape sequence in your template literal, most likely inside content's property value.
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\"content: '\\\\00d7';\\" should become \\"content: '\\\\\\\\00d7';\\".
Expand All @@ -39,7 +39,7 @@ it('warns about illegal escape sequences inside non-first quasi of template lite
}
`

expect(console.error.mock.calls[0]).toMatchInlineSnapshot(`
expect((console.error: any).mock.calls[0]).toMatchInlineSnapshot(`
Array [
"You have illegal escape sequence in your template literal, most likely inside content's property value.
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\"content: '\\\\00d7';\\" should become \\"content: '\\\\\\\\00d7';\\".
Expand Down
2 changes: 1 addition & 1 deletion site/src/templates/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Props = {
}

if (typeof window !== 'undefined') {
document.addEventListener('DOMContentLoaded', function(event) {
document.addEventListener('DOMContentLoaded', function() {
var hash = window.decodeURI(window.location.hash)
if (hash !== '' && hash !== '#') {
var element = document.getElementById(`.docSearch-content ${hash} a`)
Expand Down
14 changes: 10 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9440,10 +9440,10 @@ flexibility@^2.0.1:
resolved "https://registry.npmjs.org/flexibility/-/flexibility-2.0.1.tgz#ad323aafc40f469ce624286518fc4d7cd72b7c77"
integrity sha1-rTI6r8QPRpzmJChlGPxNfNcrfHc=

flow-bin@^0.89.0:
version "0.89.0"
resolved "https://registry.npmjs.org/flow-bin/-/flow-bin-0.89.0.tgz#6bd29c2af7e0f429797f820662f33749105c32fa"
integrity sha512-DkO4PsXYrl53V6G5+t5HbRMC5ajYUQej2LEGPUZ+j9okTb41Sn5j9vfxsCpXMEAslYnQoysHhYu4GUZsQX/DrQ==
flow-bin@^0.110.0:
version "0.110.0"
resolved "https://registry.npmjs.org/flow-bin/-/flow-bin-0.110.0.tgz#c6c140e239f662839d8f61b64b7b911f12d3306c"
integrity sha512-mmdEPEMoTuX+mguy/tjRlOlCtPfVdXZQeMgCAsEDVDgWMA5vwWhM2y653OcJiKX38t4gtZ2e/MNVo0qzyYeZDQ==

flow-parser@^0.*:
version "0.104.0"
Expand Down Expand Up @@ -10468,6 +10468,12 @@ global-prefix@^1.0.1:
version "1.0.2"
resolved "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe"
integrity sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=
dependencies:
expand-tilde "^2.0.2"
homedir-polyfill "^1.0.1"
ini "^1.3.4"
is-windows "^1.0.1"
which "^1.2.14"

global@^4.3.0:
version "4.4.0"
Expand Down

0 comments on commit a4d40aa

Please sign in to comment.