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

no longer leak StringStack from our API #929

Closed
wants to merge 1 commit into from

Conversation

devoncarew
Copy link
Member

@devoncarew devoncarew commented Dec 19, 2024

  • remove places where we were leaking StringStack from our API

This might technically be a breaking change for our users, but I assume that in practice nobody was relying on the visibility here. This leak was reported on my previous PR from the health check:

Screenshot 2024-12-19 at 12 39 54 PM

I was not able to find where we were leaking DateBuilder from.


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

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

Copy link

PR Health

Breaking changes ⚠️
Package Change Current Version New Version Needed Version Looking good?
intl Breaking 0.20.1 0.20.1 0.21.0
Got "0.20.1" expected >= "0.21.0" (breaking changes)
⚠️

This check can be disabled by tagging the PR with skip-breaking-check.

Changelog Entry
Package Changed Files
package:intl pkgs/intl/lib/src/intl/date_builder.dart
pkgs/intl/lib/src/intl/number_parser_base.dart

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

Coverage ✔️
File Coverage
pkgs/intl/lib/src/intl/date_builder.dart 💚 92 %
pkgs/intl/lib/src/intl/number_parser_base.dart 💚 92 %

This check for test coverage is informational (issues shown here will not fail the PR).

API leaks ⚠️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbols
intl StringStack
DateBuilder

This check can be disabled by tagging the PR with skip-leaking-check.

License Headers ✔️
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

@devoncarew
Copy link
Member Author

Hmm, we may still be leaking StringStack.

@devoncarew
Copy link
Member Author

Running it locally, I see:

The following declarations do not have an entry point (did you miss to export them?):
  StringStack
    Usage(s):
    - intl/date_format_field.dart::_DateFormatField::parse::input
    - intl/date_format_field.dart::_DateFormatField::parseLoose::input
    - intl/date_format_field.dart::_DateFormatField::parseLiteral::input
    - intl/date_format_field.dart::_DateFormatField::parseLiteralLoose::input
    - intl/date_format_field.dart::_DateFormatField::throwFormatException::stack
    - intl/number_parser_base.dart::NumberParserBase::parseNumber::input
  DateBuilder
    Usage(s):
    - intl/date_format_field.dart::_DateFormatField::parse::dateFields
    - intl/date_format_field.dart::_DateFormatField::parseLoose::dateFields

We may want to print local run instructions as part of the health check stdout, and or more verbose info about where things leaked from.

@devoncarew
Copy link
Member Author

The API tool seems to think things are leaking from _DateFormatField, which as a private class isn't visible outside the library.

@devoncarew
Copy link
Member Author

Ah, from date_format.dart:

  /// Parse the template pattern and return a list of field objects.
  @visibleForTesting
  @Deprecated('clients should not depend on this internal method')
  // ignore: library_private_types_in_public_api
  List<_DateFormatField> parsePattern(String pattern) {
     ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant