Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

refactor!: Seal the Dependency class #140

Merged
merged 11 commits into from
Dec 11, 2024

Conversation

spydon
Copy link
Contributor

@spydon spydon commented Nov 19, 2024

  • Thanks for your contribution! Please replace this text with a description of what this PR is changing or adding and why, list any relevant issues, and review the contribution guidelines below.

  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.

Seals the Dependency class to make it easier to pattern match over the types.

@kevmoo
Copy link
Contributor

kevmoo commented Nov 19, 2024

changelog, please!

@kevmoo
Copy link
Contributor

kevmoo commented Nov 19, 2024

Also, we'll have to make this a breaking change to be paranoid

@spydon
Copy link
Contributor Author

spydon commented Nov 19, 2024

Also, we'll have to make this a breaking change to be paranoid

Since it had a private constructor before this change nobody could extend it, so I don't think we'd have to mark this as breaking?

EDIT: Ah, but they could have extended the subclasses...

@spydon spydon changed the title refactor: Seal the Dependency class refactor!: Seal the Dependency class Nov 19, 2024
@kevmoo
Copy link
Contributor

kevmoo commented Nov 19, 2024

Also, we'll have to make this a breaking change to be paranoid

Since it had a private constructor before this change nobody could extend it, so I don't think we'd have to mark this as breaking?

EDIT: Ah, but they could have extended the subclasses...

This is the annoying bit. It's like 99% likely to NOT be a problem...but...

@spydon spydon requested a review from kevmoo November 22, 2024 13:54
@kevmoo
Copy link
Contributor

kevmoo commented Nov 22, 2024

@devoncarew @natebosch @jakemac53 – thoughts on breaking change or not here?

@spydon
Copy link
Contributor Author

spydon commented Dec 10, 2024

@kevmoo @natebosch @jakemac53 @devoncarew can we land this PR and #137 before moving the repo?

@kevmoo
Copy link
Contributor

kevmoo commented Dec 10, 2024

I'm waiting for a second opinion on sealing the classes being breaking...

@spydon
Copy link
Contributor Author

spydon commented Dec 10, 2024

I'm waiting for a second opinion on sealing the classes being breaking...

Isn't there some google stick you can poke them with? 😅

Right, now we get this of course:

Because pubspec_parse depends on json_serializable ^6.6.0 which depends on pubspec_parse ^1.0.0, pubspec_parse ^1.0.0 is required.

Imho I don't think we'd need to do a breaking change for this change, it's do incredibly unlikely that it would cause any breakage for anyone. I'll set it back to 1.3.1, and if you disagree I'll make it 2.0.0 again.

@devoncarew
Copy link
Contributor

devoncarew commented Dec 10, 2024

Imho I don't think we'd need to do a breaking change for this change, it's do incredibly unlikely that it would cause any breakage for anyone. I'll set it back to 1.3.1, and if you disagree I'll make it 2.0.0 again.

I guess the argument is that people couldn't have subclassed Dependency, they could have subclasses of SdkDependency, PathDependency, ..., but that it's unlikely that people would have actually done that? So technically a breaking change but one that's unlikely to break anyone in practice.

Do we know if the main users (a few of https://pub.dev/packages?q=dependency%3Apubspec_parse) are safe w/ this change?

@spydon
Copy link
Contributor Author

spydon commented Dec 10, 2024

@devoncarew I went through the two first pages (based on likes) and none of them extends any of the Dependency subclasses.

@natebosch
Copy link

Yeah I think it would be OK to land this without a major version change. We should switch to a feature version bump though.

Copy link

@natebosch natebosch left a comment

Choose a reason for hiding this comment

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

We will need to update the pubpsec too.

spydon and others added 2 commits December 11, 2024 14:10
@spydon
Copy link
Contributor Author

spydon commented Dec 11, 2024

@natebosch bumped to 1.4.0

@kevmoo kevmoo merged commit 3290389 into dart-archive:master Dec 11, 2024
6 checks passed
@kevmoo
Copy link
Contributor

kevmoo commented Dec 11, 2024

Thanks @spydon !

mosuem pushed a commit to dart-lang/tools that referenced this pull request Dec 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants