Skip to content

Conversation

@Hixie
Copy link
Contributor

@Hixie Hixie commented Jan 16, 2024

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

@github-actions github-actions bot added the p: rfw Remote Flutter Widgets label Jan 16, 2024
if (identifier == 'false') {
_advance();
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these identifiers be added to the reserved words list?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a blocking comment. These identifiers need to be added to the reserved words list; otherwise they could get shadowed by builders (when landed) by doing something like

Builder(
  builder: (infinity) => Container(width: infinity.width),
),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm. If we add them to the reserved words list then this becomes a breaking change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if something like flutter/flutter#141833 (comment) would be useful here as well (instead of changing the language). The implementation of number could be as follows.

final result = _fetch(...);
if (result is int) return result as int;
if (result is double) return result as double;
if (result == 'infinity') return double.infinity;
if (result == 'nan') return double.nan;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would similarly be a breaking change though.

repository: https://github.com/flutter/packages/tree/main/packages/rfw
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+rfw%22
version: 1.0.16
version: 1.0.19
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this expected? Why are 2 versions being skipped?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i have a bunch of other PRs for this package and gave them all different numbers. I'll pick the right one when I land it. :-)

expect(parseDataFile('{ "a": -1e-19 }'), <String, Object?>{ 'a': -0.0000000000000000001 });
expect(parseDataFile('{ "a": infinity }'), <String, Object?>{ 'a': double.infinity });
expect(parseDataFile('{ "a": negativeInfinity }'), <String, Object?>{ 'a': double.negativeInfinity });
expect(parseDataFile('{ "a": nan }')['a'], isNaN);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: For the sake of consistency, should this particular test be

expect(..., <String, Object?> { 'a': double.nan });

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that would fail, because double.nan == double.nan is false

peixinli
peixinli previously approved these changes Jan 17, 2024
Copy link
Contributor

@peixinli peixinli left a comment

Choose a reason for hiding this comment

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

Thanks for adding this!

@Hixie
Copy link
Contributor Author

Hixie commented Jan 23, 2024

We could make infinity and negative infinity be written as +infinity and -infinity and not support NaN. That would avoid the breaking change aspect (because those two syntaxes are errors today).

@Hixie
Copy link
Contributor Author

Hixie commented Jan 23, 2024

We could also use and -∞.

@Hixie Hixie dismissed peixinli’s stale review January 30, 2024 23:17

canceling lgtm to make sure i don't accidentally land this with the breaking change

@stuartmorgan-g
Copy link
Collaborator

From triage: what's the status of this PR? Should it be a Draft?

@Hixie
Copy link
Contributor Author

Hixie commented Mar 5, 2024

There doesn't seem to be a huge amount of interest here so I'm tempted to just close it for now until we have a clearer need.

@Hixie
Copy link
Contributor Author

Hixie commented Mar 12, 2024

closing per last comment. If you would like this feature please file a bug and cc me. Thanks!

@Hixie Hixie closed this Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: rfw Remote Flutter Widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants