Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Spelling api #193

Merged
merged 2 commits into from
Sep 11, 2024
Merged

Spelling api #193

merged 2 commits into from
Sep 11, 2024

Conversation

jsoref
Copy link
Contributor

@jsoref jsoref commented Sep 11, 2024

Copy link
Contributor

@jonasfj jonasfj left a comment

Choose a reason for hiding this comment

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

This is how APIs should be migrated.

GreatherThan is really poorly spelled 🤣, but it could happen to the best of us (and does -- repeatedly 🙈).

But it would also be sad, if we had to a disruptive major version bump, just to fix a typo.

This way we get a rename, without breaking anything, and as a cherry on top we get automated fixes!

/// Old misspelled name for [GreaterThan], retained for compatibility.
///
/// @nodoc
@Deprecated('Use FilterRelation.GreaterThan instead')
static const FilterRelation GreatherThan = FilterRelation._('>');
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
static const FilterRelation GreatherThan = FilterRelation._('>');
static const FilterRelation GreatherThan = GreaterThan;

We want identity equality to be preserved, we want GreatherThan == GreaterThan.

The _relationMapping stuff in lib/src/db/db.dart won't work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you clarify won't work?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I got it wrong, it was relationMapping in lib/src/datastore_impl.dart:

https://github.com/dart-lang/gcloud/blob/eee174cdbfaeaef0c977f0b38e26c2d0a85ce4b5/lib/src/datastore_impl.dart#L204-L210

Would cause problems in:
https://github.com/dart-lang/gcloud/blob/eee174cdbfaeaef0c977f0b38e26c2d0a85ce4b5/lib/src/datastore_impl.dart#L214-L217

Unless, GreatherThan and GreaterThan are the same object. In practice, I guess it also creates one object less to use the same object, but that's more like a nit 🤣

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Copy link
Contributor

@jonasfj jonasfj left a comment

Choose a reason for hiding this comment

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

r+

@jonasfj jonasfj merged commit c8df15e into dart-archive:master Sep 11, 2024
3 checks passed
@jsoref jsoref deleted the spelling-api branch September 11, 2024 13:52
devoncarew pushed a commit to dart-lang/labs that referenced this pull request Sep 27, 2024
* spelling: descending [api]

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: greater [api]

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

---------

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
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.

2 participants