question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migration path and breaking changes in v4

See original GitHub issue

This is not really an issue itself, but a statement that I want to pass to the kind authors and contributors to styled-components. First of all, I want to thank you for all your hard work and changing the way we style our web projects ❤️

I was really excited when v4 was announce, not only because of its improvement in performance, but also because of as attribute which will let as improve accessibility and a better global injection paradigm, at least in my opinion.

I was though surprised that there wasn’t a graceful path of migration for the new global injection API in the package. As a library maintainer, this is a must when trying to drive adoption and allow people to move to a newer version of a project which I maintain and have put time on.

In my opinion, styled-components should have a release which warn about the deprecated use of injectGlobal in favor of v4 new form.

Right now in my company we have internal dependencies, as most big companies with cross functional teams. This means that we have a design system, an app header and various product screens that are using styled-components. The problem is that the migration is quite impossible for us, or involves eternal work hours and lots of produciton and cache checks since the release of one of them using v4 will break the others.

How could this be avoided?

Supporting both APIs at some point of the releases. Why? Because then we could safely bump the version of our vendor bundle and deppendencies in our services. Then progressively migrate each part of our product, and when all were migrated we can actually bump styled-components to v4 without any worries.

Right now, it’s really hard to explain to business departments the benefit of moving to a new version given the value it really goes to the product, no matter how much we think about it it doesn’t makes sense to us and we are thinking on staying on v3 or directly move away to another css-in-js solution.

React is a good example to look at regarding developer experience, and it’s never stopped us form moving to newer versions.

I hope the team can take the feedback in a constructive way for future changes.

Cheers, Jeremias.

I’m immediatelly closing the issue to avoid noise in the repository.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
jeremenichellicommented, Apr 24, 2019

Hi @mxstbr, I want to clarify this again in case it wasn’t clear before: the team did a great job by first, releasing a better version of the library, then by documenting it and later to provide straightforward mechanisms to migrate a single project to the new version. That’s settled up 👍

I was talking about having at some point both global style APIs to allow cross functional teams to gradually migrate to v4. Right now, we have an app shell, multiple screens, and a design system consuming styled components from a vendor bundle (because you don’t want to bundle the same dependency multiple times). That said, coordinating this migration across all projects and teams is really hard, without ignoring that a user can have one of these bundles cached but download the new version of the vendor for example (because cache is complicated 🤷‍♂️) and our product will crash.

So, to give the team an update, we will need to bundle styled components on each bundle, until they are all on v4, and then switch back to rely on our vendor version of the package.

So, we will make the user download styled components three times in some parts of the product, which is still affecting bundle size and probably with a bigger impact.

Sorry for the long message, but I wanted to explain better the reasoning around this, and again it’s coming from a good place 🙏 I am an open source, library and internal tooling maintainer too and I work around migrations and DX a lot. I’m happy to jump in a call to explain this even deeper or more clear if the message and my English are confusing.

Let me know if I can help you folks with anything on this, whether is with my experience, or with coding or whatever, the communication channel is always open here. Thanks!

1reaction
probablyupcommented, Apr 17, 2019

I was though surprised that there wasn’t a graceful path of migration for the new global injection API in the package. As a library maintainer, this is a must when trying to drive adoption and allow people to move to a newer version of a project which I maintain and have put time on.

Pardon? We posted a very easy to follow migration guide AND codemods for this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Breaking changes between Neo4j v4.4 and Neo4j v5.x
When migrating to Neo4j v5, it is advisable to start from scratch with the new cluster. Make sure that you read all the...
Read more >
Migrating to v4 - Bootstrap
Stable changes​​ Moving from Beta 3 to our stable v4. x release, there are no breaking changes, but there are some notable changes....
Read more >
Migration-Guide-V4 - Fastify
This guide is intended to help with migration from Fastify v3 to v4. Before migrating to v4, please ensure that you have fixed...
Read more >
Migrating from v3 to v4 - Gatsby
While technically the change that was made is a bugfix, it can be a breaking change in your setup. Previously, if an item...
Read more >
Upgrade to Prisma 4
Upgrade path. These can all be breaking changes if you were previously configuring these properties at the database level. In this case, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found