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

4.0 Roadmap #1694

Closed
18 of 19 tasks
quantizor opened this issue Apr 17, 2018 · 23 comments
Closed
18 of 19 tasks

4.0 Roadmap #1694

quantizor opened this issue Apr 17, 2018 · 23 comments

Comments

@quantizor
Copy link
Contributor

quantizor commented Apr 17, 2018

planned

nice to have

@quantizor
Copy link
Contributor Author

cc @mxstbr @kitten for commentary and suggestions

@styled-components styled-components locked and limited conversation to collaborators Apr 17, 2018
@mxstbr
Copy link
Member

mxstbr commented Apr 17, 2018

Global style component?

@quantizor
Copy link
Contributor Author

quantizor commented Apr 17, 2018 via email

@quantizor
Copy link
Contributor Author

@kitten I wasn't sure if I should add sweetsour to the checklist just yet? I'd love to target a mid-summer release for 4.0, depending on how much time we have.

@mxstbr
Copy link
Member

mxstbr commented Apr 19, 2018

@probablyup 😍😍😍😍😍😍

@mxstbr
Copy link
Member

mxstbr commented Apr 19, 2018

update documentation to strongly recommend using the babel plugin (will be required to use styled.x syntax vs styled('x'))

I'm not a big fan of the bold part.

Instead, we should have the "default" bundle which does ship with the tag list, and then as soon as you install the Babel plugin it transpiles it to use a different entry point without the tag list automatically under the hood:

// ⬇⬇⬇⬇⬇ In ⬇⬇⬇⬇⬇
import styled from 'styled-components';

const Button = styled.button`
  color: blue;
`

// ⬇⬇⬇⬇⬇ Out ⬇⬇⬇⬇⬇
import styled from 'styled-components/no-tag-list';

const Button = styled('button')`
  color: blue;
`

That way, beginner users who are just dipping their toes into styled-components can use it just like all the docs and articles around it suggest without problems, and then once they graduate to using it seriously it should be obvious that you should be using the Babel plugin which automatically gets you huge size gains. We could even do a simple check whether the default bundle was used in production and emit a console.warn("Please use the Babel plugin for massive size savings!").

Potentially we could also sacrifice browser compat in the default bundle and use a proxy, but I'm not a big fan of that simply because create-react-app users won't have a way to opt-into better browser support.

@quantizor
Copy link
Contributor Author

quantizor commented May 11, 2018

@mxstbr I kinda see what you're saying but from the perspective of someone using the library, I'd rather be told the correct way to do something from the onset so I didn't have to go back and refactor it all later, you know?

@mxstbr
Copy link
Member

mxstbr commented May 11, 2018

@probablyup but it's not a refactoring at all, it's fully automatic? Once you're ready to go full prod mode we recommend you drop in the Babel plugin—you just don't have to use it from the onset.

@migueloller
Copy link
Member

Are there any plans to change the innerRef prop to ref and leverage React 16.3 forwardRef?

@quantizor
Copy link
Contributor Author

@migueloller yup definitely, that's part of the "drop React 15 support and switch to React 16-compliant lifecycle methods, etc without polyfills" item!

@migueloller
Copy link
Member

@probablyup Awesome! 😄

@quantizor
Copy link
Contributor Author

https://github.com/styled-components/styled-components/tree/develop is the 4.0 branch 🎉

First big piece of this is going in soon, thanks to #1894

@styled-components styled-components unlocked this conversation Aug 9, 2018
@quantizor quantizor changed the title [WIP] 4.0 Roadmap 4.0 Roadmap Aug 11, 2018
@alexandernanberg
Copy link
Member

alexandernanberg commented Aug 12, 2018

I think we can check off the "unsafe async-lifecycles" task after #1894 got merged. Can't find any references to componentWillReceiveProps, componentWillMount or componentWillUpdate anywhere but in the benchmark code (could send in a PR for this but the we might get misleading results compared to master)

I'd also like to add "Use React.forwardRef API" to the checklist, that way we won't have to use a innerRef prop anymore.

Stylis is having an ongoing rewrite so that's something we might want to add in v4 as well

@quantizor
Copy link
Contributor Author

@alexandernanberg Yup I think that context API work ended up checking off a lot of things! 😄

forwardRef is definitely something we want to do. You're welcome to pick it up if you have time!

@alexandernanberg
Copy link
Member

alexandernanberg commented Aug 12, 2018

@probablyup Cool! Yeah I'd definitely like to do that when I got some extra time over 😄

Edit: So right now enzyme doesn't support React.forwardRef which blocks us from adding this because it breaks a lot of test. When this PR gets merged and they release a new version we can revisit this. Unless someone has a solution to this.

@Andarist
Copy link
Contributor

👋 From what I understand you are approaching v4 release and I would like to make a proposal for it.

While prop whitelist is obviously non-ideal solution and has its costs (2kb+) the approach is used by more than 1 library, it would be great if we could just use for the time being the same module for it so the cost would be one time thing.

I'd like to propose using is-prop-valid. It's obviously used by emotion, but also by popmotion since recently and I know that if we could all agree on a single module @diegohaz would love to dedupe his copied validAttr from reakit.

Your solution is more correct (i.e. validating post data- characters) but IMHO this is not really needed, the solution without that extreme correctness is "good enough" and is also slightly lighter (~0.5kb from what I remember).

@quantizor
Copy link
Contributor Author

@Andarist checking it out now

@quantizor
Copy link
Contributor Author

@Andarist I think we can use it but they're missing some props - going to make an issue now

@Andarist
Copy link
Contributor

Super! Just to add - I have not consulted any other emotion team member on this, just got the ball rolling here. I don't think anyone on the team will have anything against it though.

@ctretyak
Copy link

ctretyak commented Oct 3, 2018

What about new typings for TypeScript like createGlobalStyle ?

@Andarist
Copy link
Contributor

Andarist commented Oct 3, 2018

The TS typings were moved out of the repository so that's job for DefinitelyTyped community, not styled-components team.

@LavaToaster
Copy link
Member

@ctretyak I'm already on it. 😄 Watch this issue and then within a day after it gets merged it'll be available for use. DefinitelyTyped/DefinitelyTyped#29389

@mxstbr
Copy link
Member

mxstbr commented Oct 3, 2018

Thanks so much @Lavoaster!

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

No branches or pull requests

7 participants