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

[babel-plugin-emotion][react-emotion] Adds Support for Components as Selectors Using the Object Syntax #501 #503

Merged
merged 5 commits into from
Dec 23, 2017
Merged

[babel-plugin-emotion][react-emotion] Adds Support for Components as Selectors Using the Object Syntax #501 #503

merged 5 commits into from
Dec 23, 2017

Conversation

stoutmusclenugget
Copy link
Contributor

@stoutmusclenugget stoutmusclenugget commented Dec 23, 2017

Issue #501

What: Adding the ability to use components as selectors when object syntax is being used.

Why: To achieve api parity regardless of the syntax being used.

How: Under direction of @mitchellhamilton via comments on issue #501.

Checklist:

  • Documentation
  • Tests
  • Code complete

Copy link
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!! It would be great to have specific documentation for it, could you add an example with the object syntax below the string one in docs/styled.md?

process.env.NODE_ENV !== 'production' &&
stableClassName === undefined
) {
throw new Error('')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add make this error be 'Component selectors can only be used in conjunction with babel-plugin-emotion.'

@stoutmusclenugget
Copy link
Contributor Author

@mitchellhamilton Absolutely! I will add the documentation right away. It looks like CI is failing because of the size? Is this going to be an issue?

@emmatown
Copy link
Member

@smlmrkhlms In the root package.json, in the bundlesize section, increase the react-emotion limit to 9.1kb

@codecov
Copy link

codecov bot commented Dec 23, 2017

Codecov Report

Merging #503 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted Files Coverage Δ
packages/babel-plugin-emotion/src/index.js 96.49% <100%> (+0.08%) ⬆️
packages/react-emotion/src/index.js 100% <100%> (ø) ⬆️

@emmatown
Copy link
Member

Could you add a test here to with something like this

expect(() => {
// try to use a component selector with the object syntax
}).toThrowErrorMatchingSnapshot()

@emmatown emmatown merged commit 3a33cdc into emotion-js:master Dec 23, 2017
@stoutmusclenugget
Copy link
Contributor Author

@mitchellhamilton Thanks for your help and guidance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants