Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Use Hooks #967

Merged
merged 34 commits into from
Nov 5, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4c74a12
Tests are broken :( but it works
emmatown Oct 26, 2018
2560905
Add displayName
emmatown Oct 26, 2018
b0a2363
Use ref
emmatown Oct 26, 2018
1608f42
Remove stuff
emmatown Oct 26, 2018
306886f
Update react-test-renderer
emmatown Oct 26, 2018
6b1bbfc
Use useContext in more places
emmatown Oct 26, 2018
3b84076
Fix a Global insertion order bug
emmatown Oct 26, 2018
44f6c7e
Add a test
emmatown Oct 26, 2018
6c5fa1a
Fix typo
emmatown Oct 26, 2018
587b561
Merge branch 'master' into hooks
emmatown Oct 26, 2018
dd42c9c
Merge branch 'master' into hooks
emmatown Oct 27, 2018
897fede
Remove passing the theme to the css prop, Global and ClassNames
emmatown Oct 28, 2018
1aa4655
Merge branch 'master' into hooks
emmatown Oct 31, 2018
2bf9383
Merge branch 'master' into hooks
emmatown Nov 25, 2018
9d8cc37
stuff
emmatown Nov 25, 2018
e725feb
stuff
emmatown Nov 25, 2018
fae9f0a
changes
emmatown Nov 25, 2018
33df35a
Merge branch 'master' into hooks
emmatown Nov 25, 2018
d1e3293
Add a test back
emmatown Nov 25, 2018
b899c8b
Fix a thing
emmatown Nov 25, 2018
cb0feb2
Update stuff
emmatown Nov 25, 2018
70118b7
Merge branch 'master' into hooks
emmatown May 22, 2019
7e9b819
Update things
emmatown May 22, 2019
4890527
Merge branch 'next' into hooks
Andarist Nov 5, 2019
95b1398
Drop support for innerRef entirely
Andarist Nov 5, 2019
8b6bee6
Set correct peerDeps on react + upgrade react-related devDeps
Andarist Nov 5, 2019
407a062
Merge branch 'next' into hooks
Andarist Nov 5, 2019
6e98780
Fix tests
Andarist Nov 5, 2019
a6439f2
Fix linting error
Andarist Nov 5, 2019
bd7222e
Remove custom useContext flow types
Andarist Nov 5, 2019
65d1ccc
Fix flow error
Andarist Nov 5, 2019
e45467d
Fix layour effect input array to include serialized.name instead of w…
Andarist Nov 5, 2019
1103861
Add a changeset
emmatown Nov 5, 2019
6af574b
Add another changeset
emmatown Nov 5, 2019
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
Prev Previous commit
Next Next commit
Merge branch 'next' into hooks
# Conflicts:
#	.flowconfig
#	.flowconfig-ci
#	.github/ISSUE_TEMPLATE.md
#	package.json
#	packages/core/src/global.js
#	packages/core/src/jsx.js
#	packages/styled-base/src/index.js
#	yarn.lock
  • Loading branch information
Andarist committed Nov 5, 2019
commit 4890527a9941a04f34d301e0ff3a22272f95e414
1 change: 0 additions & 1 deletion .changeset/14b4f988/changes.json

This file was deleted.

1 change: 0 additions & 1 deletion .changeset/14b4f988/changes.md

This file was deleted.

115 changes: 0 additions & 115 deletions .changeset/config.js

This file was deleted.

30 changes: 30 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://unpkg.com/@changesets/config@0.2.1/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "emotion-js/emotion" }
],
"commit": false,
"linked": [
[
"@emotion/core",
"@emotion/styled",
"@emotion/styled-base",
"@emotion/cache",
"@emotion/css",
"create-emotion",
"emotion",
"emotion-server",
"create-emotion-server",
"babel-plugin-emotion",
"@emotion/babel-preset-css-prop",
"jest-emotion",
"@emotion/native",
"@emotion/primitives",
"@emotion/primitives-core",
"eslint-plugin-emotion",
"emotion-theming"
]
],
"access": "public"
}
5 changes: 5 additions & 0 deletions .changeset/flat-adults-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'jest-emotion': patch
---

Take specificity into account when matching styles
5 changes: 5 additions & 0 deletions .changeset/light-mice-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'babel-plugin-emotion': patch
---

Avoid transpiling vanilla emotion calls in already transpiled code to avoid double labels and such
31 changes: 31 additions & 0 deletions .changeset/long-apes-admire/changes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"releases": [
{ "name": "@emotion/css", "type": "minor" },
{ "name": "emotion-theming", "type": "minor" },
{ "name": "@emotion/serialize", "type": "minor" },
{ "name": "@emotion/styled-base", "type": "minor" },
{ "name": "@emotion/styled", "type": "minor" }
],
"dependents": [
{
"name": "babel-plugin-emotion",
"type": "patch",
"dependencies": ["@emotion/serialize"]
},
{
"name": "@emotion/core",
"type": "patch",
"dependencies": [
"@emotion/css",
"emotion-theming",
"@emotion/serialize",
"@emotion/styled"
]
},
{
"name": "create-emotion",
"type": "patch",
"dependencies": ["@emotion/serialize"]
}
]
}
31 changes: 31 additions & 0 deletions .changeset/long-apes-admire/changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
TypeScript types have been restructured. These changes:

- Reduce build times when using emotion
- In many cases remove the need for manually specifying generic parameters for your emotion components.

If you encounter build issues after upgrade, try removing any manually specified generic types and let them be inferred. Otherwise refer to the breaking changes list below.

## Improvements

- useTheme added to EmotionTheming interface and can now create your own closed variation of withTheme. More information in the docs under the theming section.
- Union types as props are better supported and should be inferred properly
- Build times should be reduced significantly in larger projects.

## Breaking changes

- withTheme can now have the Theme type specified when calling it. For example `withTheme<MyTheme>(MyComponent)`

**Breaking change:** Generic argument changed, if you were specifying the ComponentType you will need to remove the generic parameter. Recommend following example setup in the TypeScript docs under theming section

- `css` function has been restricted to prevent passing of invalid types
- `CreateStyled` functions no longer take a second `ExtraProps` argument. Instead move it to after the create styled call. For example

`styled<typeof MyComponent, ExtraProps>(MyComponent)({})`
to
`styled(MyComponent)<ExtraProps>({})`

- `StyledComponent` type no longer supports the third generic `Theme` parameter. Instead add the `theme` prop to the first `Props` argument. For example:

`StyledComponent<Props, {}, MyTheme>`
to
`StyledComponent<Props & { theme?: MyTheme }>`
46 changes: 46 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"babel-plugin-emotion": "10.0.23",
"@emotion/babel-plugin-jsx-pragmatic": "0.1.4",
"@emotion/babel-preset-css-prop": "10.0.23",
"@emotion/cache": "10.0.19",
"@emotion/core": "10.0.22",
"create-emotion": "10.0.14",
"create-emotion-server": "10.0.14",
"@emotion/css": "10.0.22",
"emotion": "10.0.23",
"emotion-server": "10.0.17",
"emotion-theming": "10.0.19",
"eslint-plugin-emotion": "10.0.14",
"@emotion/hash": "0.7.3",
"@emotion/is-prop-valid": "0.8.5",
"jest-emotion": "10.0.17",
"@emotion/memoize": "0.7.3",
"@emotion/native": "10.0.22",
"@emotion/primitives": "10.0.24",
"@emotion/primitives-core": "10.0.22",
"@emotion/serialize": "0.11.14",
"@emotion/sheet": "0.9.3",
"@emotion/styled": "10.0.23",
"@emotion/styled-base": "10.0.24",
"@emotion/stylis": "0.8.4",
"@emotion/unitless": "0.7.4",
"@emotion/utils": "0.11.2",
"@emotion/weak-memoize": "0.2.4",
"example": "0.6.17",
"my-razzle-app": "0.1.3",
"babel-preset-emotion-dev": "9.2.6",
"babel-tester": "0.4.5",
"benchmarks": "0.8.27",
"old-babel-tester": "0.4.5",
"ssr-benchmarks": "0.8.13",
"test-utils": "0.3.2",
"emotion-site": "9.3.0"
},
"changesets": [
"light-mice-relate",
"rare-books-own"
]
}
18 changes: 18 additions & 0 deletions .changeset/rare-books-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'babel-plugin-emotion': major
'@emotion/cache': major
'@emotion/core': major
'create-emotion': major
'create-emotion-server': major
'@emotion/css': major
'emotion': major
'emotion-server': major
'emotion-theming': major
'jest-emotion': major
'@emotion/native': major
'@emotion/primitives': major
'@emotion/primitives-core': major
'@emotion/styled': major
---

Ensure packages are major bumped so that pre-release versions of the linked packages are consistent in the major number
5 changes: 5 additions & 0 deletions .changeset/rare-toes-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'jest-emotion': patch
---

Match rules in declarations with component used as a selector
9 changes: 5 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
flow:
docker:
- image: circleci/node:10.6.0-browsers
- image: circleci/node:10.16.3-browsers
working_directory: ~/repo
steps:
- checkout
Expand All @@ -25,7 +25,7 @@ jobs:

test:
docker:
- image: circleci/node:10.6.0
- image: circleci/node:10.16.3
working_directory: ~/repo
steps:
- checkout
Expand All @@ -48,7 +48,7 @@ jobs:

test_dist:
docker:
- image: circleci/node:10.6.0
- image: circleci/node:10.16.3
working_directory: ~/repo
steps:
- checkout
Expand All @@ -66,7 +66,7 @@ jobs:

lint_and_typescript:
docker:
- image: circleci/node:10.6.0
- image: circleci/node:10.16.3
working_directory: ~/repo
steps:
- checkout
Expand All @@ -77,6 +77,7 @@ jobs:
- v4-dependencies-
- run: yarn install --pure-lockfile
- run: yarn lint:check
- run: yarn test:typescript

workflows:
version: 2
Expand Down
5 changes: 4 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[version]
0.98.1
0.110.0

[ignore]
.*/node_modules/config-chain/.*
.*/node_modules/styled-components/.*
.*/node_modules/graphql/.*
.*/node_modules/metro.*
.*/node_modules/preact/.*
.*/node_modules/@parcel/.*

[untyped]
.*/node_modules/polished/.*
Expand All @@ -22,3 +23,5 @@

[options]
suppress_comment=.*\\$FlowFixMe
suppress_comment=.*\\$FlowExpectError
sharedmemory.hash_table_pow=21
6 changes: 5 additions & 1 deletion .flowconfig-ci
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[version]
0.98.1
0.110.0

[ignore]
.*/node_modules/config-chain/.*
.*/node_modules/styled-components/.*
.*/node_modules/graphql/.*
.*/node_modules/metro.*
.*/node_modules/preact/.*
.*/node_modules/@parcel/.*


[untyped]
.*/node_modules/polished/.*
Expand All @@ -22,4 +24,6 @@

[options]
suppress_comment=.*\\$FlowFixMe
suppress_comment=.*\\$FlowExpectError
server.max_workers=1
sharedmemory.hash_table_pow=21
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: emotion
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.