Skip to content

Remove river.JobState* aliases in favor of using rivertype directly - #300

Merged
brandur merged 1 commit into
masterfrom
brandur-unambiguous-job-state
Apr 19, 2024
Merged

Remove river.JobState* aliases in favor of using rivertype directly#300
brandur merged 1 commit into
masterfrom
brandur-unambiguous-job-state

Conversation

@brandur

@brandur brandur commented Apr 15, 2024

Copy link
Copy Markdown
Contributor

One of the accidental API misdesigns I forgot to address on the initial
version of River was that type aliases for JobState* had been left in
the top-level river namespace.

Having them in river may make use slightly more convenient, but makes
"jump to definition" worse because it requires an additional redirect,
and the decision to use river or rivertype ambiguous in that there's
no canonically correct answer. The aliases also make adding a new state
a little more risky because the alias may be forgotten.

I wouldn't normally make this change post-ship, but given we're doing a
couple breaking changes all at once, it's our last, best opportunity to
fix the (mild) problem.

@brandur brandur added the breaking change Breaking API change label Apr 15, 2024
@brandur
brandur force-pushed the brandur-unambiguous-job-state branch from ab71ec6 to 5850172 Compare April 15, 2024 02:13
@brandur
brandur requested a review from bgentry April 15, 2024 02:18

@bgentry bgentry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wish we didn't end up having to put these in a sub-package to begin with, but since we did, this is the right call.

Do you think there are any website or other doc fixes required for this?

@brandur

brandur commented Apr 15, 2024

Copy link
Copy Markdown
Contributor Author

Do you think there are any website or other doc fixes required for this?

Nah, I think we're okay there (also no example tests needed to be updated).

$ cd /Users/brandur/Documents/projects/river-homepage
$ ag 'river\.JobState'
$

@brandur
brandur force-pushed the brandur-unambiguous-job-state branch from 5850172 to 933002c Compare April 16, 2024 01:41
One of the accidental API misdesigns I forgot to address on the initial
version of River was that type aliases for `JobState*` had been left in
the top-level `river` namespace.

Having them in `river` may make use slightly more convenient, but makes
"jump to definition" worse because it requires an additional redirect,
and the decision to use `river` or `rivertype` ambiguous in that there's
no canonically correct answer. The aliases also make adding a new state
a little more risky because the alias may be forgotten.

I wouldn't normally make this change post-ship, but given we're doing a
couple breaking changes all at once, it's our last, best opportunity to
fix the (mild) problem.
@brandur
brandur force-pushed the brandur-unambiguous-job-state branch from 933002c to c9ab5f5 Compare April 19, 2024 02:06
@brandur

brandur commented Apr 19, 2024

Copy link
Copy Markdown
Contributor Author

With #304 in, going to start merging these other changes prior to release.

@brandur
brandur merged commit cd2d760 into master Apr 19, 2024
@brandur
brandur deleted the brandur-unambiguous-job-state branch April 19, 2024 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Breaking API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants