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

UIAPPS-104 Link UI Extensions packages #97

Merged
merged 2 commits into from
Jan 19, 2022

Conversation

joneshf-dd
Copy link
Collaborator

@joneshf-dd joneshf-dd commented Jan 19, 2022

Motivation

Changes

  • We make it so any package that starts with @datadog/ui-extensions- gets locked together with the same version. This took some extra work to make changesets still work the way we want. Hopefully if Add support for fixed packages changesets/changesets#690 merges, it'll mean we can remove a lot of this behavior.
    There's also a patch that we had to do to the @changesets/assemble-release-plan package that we should ask about.

Testing

Releases

Choose one:

  • No release is necessary.
    If you're only updating examples/documentation, this is likely what you want.
  • All packages that need a release have a changeset.
📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @datadog/[email protected]
npm install @datadog/[email protected]
npm install @datadog/[email protected]
# or 
yarn add @datadog/[email protected]
yarn add @datadog/[email protected]
yarn add @datadog/[email protected]

We want all `@datadog/ui-extensions-` packages to have the same version.

This is explained in more detail in the `RELEASE.md` file. The long and
short is that it should be easier on App Developers if they don't have
to manage different sets of versions, and rather can just install one
version for everything.

We add a script that checks that all the `@datadog/ui-extensions-*`
packages have a changeset if any of them do. This script works in tandem
with the change to `.changeset/config.json` where we link all
`@datadog/ui-extensions-*` packages together. It's a bit unfortunate
that we have to roll a script for this, but it's not the end of the
world. If changesets gets this behavior, we can move over to using that
instead of this two-pronged approach.

Now, we can start adding packages.
We don't want to force a major bump unnecessarily.

For our use case, we don't want the packages to bump a major version. We
should ask upstream what the situation is and if there's a way to get
the behavior we want.
Comment on lines +7 to +25
* Checks that if any `@datadog/ui-extensions-*` package is getting a release,
* all `@datadog/ui-extensions-*` packages are getting a release.
*
* While `changesets` does have support for "linked" packages:
* https://github.com/changesets/changesets/blob/main/docs/linked-packages.md,
* it's not exactly what we want.
* The way "linked" packages work,
* we can still leave out packages that we want to be on the same version.
*
* We do still want "linked" packages in our `.changeset/config.json`,
* since it means we'll always get everything on the same version.
* To that end,
* this check doesn't need to actually look at specific version numbers.
* We just have to catch packages that might be missed.
*
* The behavior we want is actually what's being proposed as "fixed" packages:
* https://github.com/changesets/changesets/pull/690.
* Until that feature is released,
* we have this check to make sure we release packages in lock-step.
Copy link
Collaborator

Choose a reason for hiding this comment

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

wow thank you for enforcing this in code and documenting so well. I tend to opt for manual enforcement of such things, which inevitably ends up not working

@joneshf-dd
Copy link
Collaborator Author

thanks for the review!

@joneshf-dd joneshf-dd merged commit abbb7fb into master Jan 19, 2022
@joneshf-dd joneshf-dd deleted the hardy.jones/uiapps-104/link-ui-extensions-packages branch January 19, 2022 20:11
@Andarist
Copy link

Andarist commented Feb 5, 2022

@joneshf-dd I've noticed that you are interested in the fixed mode that is being implemented for Changesets. I'm wondering if you have looked into the PR and if it matches your expectations or if maybe you have imagined the feature to work differently?

@joneshf-dd
Copy link
Collaborator Author

joneshf-dd commented Feb 7, 2022

Hey, thanks for reaching out!

I think based on the description, and the linked conversations, it'll likely do what we want. But I haven't run any of that code yet, so I can't say with certainty. E.g. We found that the behavior of peer dependency version bumps didn't quite work out how we wanted and had to work around that. Even if there are things that don't work quite the way we want, if it lets us get rid of our ~60 lines of reactionary code in favor of a single line of proactive config, it'll be a win in my book.

No matter the case, I'm excited to try out the fixed mode. Can't wait for it to land!

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.

3 participants