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

Deprecate Point, Rectangle, and MutableRectangle in dart:math #54852

Open
parlough opened this issue Feb 7, 2024 · 0 comments
Open

Deprecate Point, Rectangle, and MutableRectangle in dart:math #54852

parlough opened this issue Feb 7, 2024 · 0 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. deprecation library-math type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable

Comments

@parlough
Copy link
Member

parlough commented Feb 7, 2024

Now that dart:html usage has been decreasing and is going to continue to. They were moved from dart:html as part of #9213, but that continued to be their primary use.

A Point on a screen does not really belong in a math library, nor does Rectangle. Beyond that, Point declares operators that don't make sense for a point, conflating it with a vector. The * operator on Point<int> can also result in a runtime error when provided with a double 😢.

Some related discussion about performance concerns: #53912


All this isn't to say the functionality they provide isn't useful, but the use cases can now be better supported by focused packages that are easier to evolve. A lot of the previous uses are likely covered by a simple record too.

@parlough parlough added the area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. label Feb 7, 2024
@parlough parlough added library-math type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable deprecation labels Feb 12, 2024
copybara-service bot pushed a commit that referenced this issue Feb 14, 2024
These can't be deprecated for a while, at least not until 'dart:html' itself is.

In the mean time, we can at least discourage usage of it and direct developers to more appropriate, long-term solutions.

Contributes to #54852

CoreLibraryReviewExempt: Documentation only change that directs developers to more specific, performant, or flexible solutions.
Change-Id: I9d099a49909673f8af23eab480fdd225e56bcab2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351961
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. deprecation library-math type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable
Projects
None yet
Development

No branches or pull requests

1 participant