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

Combine repos #870

Closed
11 tasks done
mayank99 opened this issue Dec 20, 2022 · 1 comment · Fixed by #868, #876, #929, #932 or #875
Closed
11 tasks done

Combine repos #870

mayank99 opened this issue Dec 20, 2022 · 1 comment · Fixed by #868, #876, #929, #932 or #875
Assignees
Labels
maintenance Related to development or technical debt or chores

Comments

@mayank99
Copy link
Contributor

mayank99 commented Dec 20, 2022

Problem

Currently, iTwinUI and iTwinUI-react are two separate repos. The initial idea behind this was that the CSS should be usable independently of React. But that only requires separate packages, not separate repos. Having packages that are often changed together live in separate repos causes friction. Every CSS change needs to be released and propagated to React, which is a slow, blocking process. Even after it's consumed, we sometimes find that we need to make more changes which means redoing this whole cumbersome process.

Additionally, our repo names are confusing for users who want to create issues/discussions. They are even confusing for ourselves when it comes to backlog management. Issues often need to get moved between repos. PRs sometimes get "lost" after merging in CSS, which results in CSS changes that don't get consumed in React for long periods of time, if at all.

Lastly, our changelog and release process, while better than something entirely manual like we had before, is a bit problematic. Conventional commit requirements have been hard to follow. PR titles are usually too small to be useful as changelogs. I personally often find myself manually expanding the changelog text when releasing. And the iTwinUI repo is not multi-package aware so there is currently no way of automating releases for itwinui-variables.

Solution

Combine the monorepos and merge their git histories. Specifically, iTwinUI-react will be merged into iTwinUI. Since we are already using turborepo in both repos, a lot of this should be very straightforward to get running and I don't expect many merge conflicts.

The single monorepo will contain the code for all three packages (itwinui-variables, itwinui-css, itwinui-react) as well as all the demos, tests and examples. changeset will be used for a release/changelog process that is more suited for multiple packages. The old repo will be archived.

Estimated time: one week. This could be done over the holidays when we are allowed to have some downtime.

Benefits

  • Better developer experience. All related changes can be made and previewed together. Saving a .scss file will instantly reflect all the way over in storybook. Faster feedback loop also means less chance of missing something, and no need to go back and forth or wait for releases. I expect we will likely ship things faster as a result.
  • Better repo management. Users don't need to keep track of multiple repos. Non-technical users (e.g. UX team) know exactly where to look. Issues don't need to be moved back and forth.
  • Better changelogs and release process. changeset's philosophy is to make changelogs part of the PR process, so there is no burden on the person making the release to expand changelogs. Additionally, it will be able to manage the release of multiple packages, as it's specifically designed for monorepos.
  • Less duplication. Readmes, prettier configs, eslint, issue templates, PR templates, github workflows can all be shared so we don't need to make the same change in two repos.
  • More flexible. This also opens the door for us to make drastic changes in the future if we so desire. We could add layouts and icons into this repo if we wanted. We could split up react into multiple packages (e.g. having Table in a separate package). Since scss and react live in the same repo, we could potentially do some build-time shenanigans like using mixins to generate unique classnames that don't conflict between major versions.

Downsides

  • Need to spend some time getting the CI/CD process working (build/test/deploy/release).
  • There could be some downtime while waiting for this migration.
  • Uncertainty. We might not have considered something now and run into an issue later.

Imo the benefits far outweigh the downsides.

Action items

@mayank99 mayank99 self-assigned this Dec 20, 2022
@mayank99 mayank99 added the maintenance Related to development or technical debt or chores label Dec 20, 2022
@mayank99 mayank99 linked a pull request Dec 20, 2022 that will close this issue
4 tasks
@mayank99 mayank99 removed a link to a pull request Dec 22, 2022
4 tasks
@mayank99
Copy link
Contributor Author

Reposting #868 (comment) here for visibility:

  • configs maybe can be moved outside packages
  • createComponent scripts can be combined to create both css and react files
  • copyrightLinter script can be combined.
  • easier/less confusing way to "approve" images for css/react from root
  • update and validate CONTRIBUTING guide
  • update and validate issue/PR templates
  • chore: Fix errors in astro workspaces #929

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment