facebook / docusaurus

Easy to maintain open source documentation websites.
https://docusaurus.io
MIT License
56.67k stars 8.52k forks source link

swizzle --patch #5734

Open Josh-Cena opened 3 years ago

Josh-Cena commented 3 years ago

💥 Proposal

We can make swizzle something similar to yarn patch: it lets you change a file and only records the diff. During an upgrade, if there's a "merge conflict", it asks you to reswizzle the component.

I have no idea how heavy the implementation would be on our side, or if there are packages we can use

Have you read the Contributing Guidelines on issues?

Yes

slorber commented 3 years ago

Hey

As part of https://github.com/facebook/docusaurus/issues/5380, I'd like to encourage swizzle --wrap for most use-cases instead of swizzle --copy (ie current behavior).

I'm trying to see with Facebook how to handle versioning once v2.0 is released:

Even if --copy wouldn't be the recommended thing to do, we'll still need to reduce annoying updates for our users.

For now, I think we should focus on shipping swizzle --wrap and a good, explicit theme public API,


We'll figure out tooling to support swizzle --copy better later.

An idea is to build a web tool to help users upgrade their theme components highlighting the theme changes for convenient backporting, similar to the React-Native upgrade-helper website: https://react-native-community.github.io/upgrade-helper/?from=0.62.0&to=0.67.0-rc.0

I was also thinking about providing a patch system, a bit different than yours: