Skip to content

[record_use] Add Recordings.+ - #3510

Merged
auto-submit[bot] merged 1 commit into
mainfrom
record-use-merge
Jul 31, 2026
Merged

auto-submit[bot] merged 1 commit into
mainfrom
record-use-merge

Conversation

@dcharkes

Copy link
Copy Markdown
Collaborator

So we can combine two recordings.

Use case dart2wasm + dart2js compilation fallbacks in Flutter. Conditional imports can make it so that they are not necessarily a super set of each other, they might be disjoint. So picking one to default to does not give the right semantics.

Context:

@github-actions

github-actions Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Package publishing

If you have publishing permissions, you can use the links below to publish the changes after merging this PR.

Package Version Status Publish tag (post-merge)
package:code_assets 1.3.0-wip WIP (no publish necessary)
package:data_assets 0.20.0 already published at pub.dev
package:ffi 2.2.0 already published at pub.dev
package:hooks 2.2.0-wip WIP (no publish necessary)
package:hooks_runner 1.6.2-wip WIP (no publish necessary)
package:jni_flutter 1.0.2 already published at pub.dev
package:jni_util 1.0.0 already published at pub.dev
package:native_toolchain_c 0.19.4-wip WIP (no publish necessary)
package:record_use 1.1.0 ready to publish record_use-v1.1.0
package:swift2objc 0.3.0-wip WIP (no publish necessary)
package:swiftgen 0.1.3 already published at pub.dev

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

@github-actions

github-actions Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

PR Health

Changelog Entry ✔️
Package Changed Files

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.

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 symbol Leaking sources

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

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?
record_use Non-Breaking 1.0.0 1.1.0 1.1.0 ✔️

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

Comment thread pkgs/record_use/lib/src/recordings.dart Outdated
/// are combined in the returned [Recordings].
Recordings merge(Recordings other) {
final newCalls = <DefinitionWithStaticCalls, List<CallReference>>{};
for (final entry in calls.entries) {

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.

DRY. This could be factored into a little util that merges maps.

Side note, you can merge them using a single map literal statement 😉, though it's definitely a matter of personal taste which you prefer:

Map<K, List<V>> _merge(Map<K, List<V>> a, Map<K, List<V>> b) => {
      for (final k in {...a.keys, ...b.keys}) k: [...(a[k] ?? []), ...(b[k] ?? [])]
    };

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done.

And renamed to the plus operator.

@dcharkes dcharkes changed the title [record_use] Add Recordings.merge [record_use] Add Recordings.+ Jul 31, 2026

@goderbauer goderbauer 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.

LGTM

@auto-submit auto-submit Bot removed the autosubmit label Jul 31, 2026
@auto-submit

auto-submit Bot commented Jul 31, 2026

Copy link
Copy Markdown

autosubmit label was removed for dart-lang/native/3510, because - The status or check suite build (windows, dev) has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit
auto-submit Bot merged commit a9ec3df into main Jul 31, 2026
61 of 62 checks passed
@auto-submit
auto-submit Bot deleted the record-use-merge branch July 31, 2026 13:51
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.

3 participants