Skip to content

[native_assets_builder] Refactor API to ProtocolExtensions #2089

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

Merged
merged 2 commits into from
Mar 11, 2025

Conversation

dcharkes
Copy link
Collaborator

@dcharkes dcharkes commented Mar 11, 2025

This PR introduces a concept of protocol extensions, which package together everything belonging to a protocol extension.

Closes: #2088

As a bonus, this better abstraction reduces LOC.

The validation methods are now all internal to the extensions. The setup methods stay exported because they are used extensively in hook-helper-packages (e.g. native_toolchain_c).

Copy link

PR Health

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?
Changelog Entry ✔️
Package Changed Files

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

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
License Headers ✔️
// Copyright (c) 2025, 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.

Unrelated files missing license headers
Files
pkgs/jni/lib/src/third_party/generated_bindings.dart
pkgs/objective_c/lib/src/ns_input_stream.dart

@coveralls
Copy link

coveralls commented Mar 11, 2025

Coverage Status

coverage: 87.673% (-0.2%) from 87.89%
when pulling 6bfde64 on protocol-extension-api
into 2dba4f5 on main.

Copy link
Member

@mosuem mosuem left a comment

Choose a reason for hiding this comment

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

LGTM! Feel free to add more documentation though.

import '../../code_assets_builder.dart';
import 'validation.dart';

final class CodeAssetExtension implements ProtocolExtension {
Copy link
Member

Choose a reason for hiding this comment

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

Missing documentation

import '../../data_assets_builder.dart';
import 'validation.dart';

final class DataAssetsExtension implements ProtocolExtension {
Copy link
Member

Choose a reason for hiding this comment

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

Missing docs

required BuildValidator buildValidator,
required ApplicationAssetValidator applicationAssetValidator,
required List<String> buildAssetTypes,
required List<ProtocolExtension> extensions,
Copy link
Member

Choose a reason for hiding this comment

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

Add docs about the extensions parameter - why do we need to pass it?

@auto-submit auto-submit bot merged commit 0cd2e55 into main Mar 11, 2025
40 checks passed
@auto-submit auto-submit bot deleted the protocol-extension-api branch March 11, 2025 14:50
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.

[native_assets_builder] Introduce ProtocolExtension
3 participants