Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: support mieru protocol #1702

Merged
merged 1 commit into from
Dec 9, 2024
Merged

feat: support mieru protocol #1702

merged 1 commit into from
Dec 9, 2024

Conversation

enfein
Copy link

@enfein enfein commented Dec 9, 2024

update #1697

@wwqgtxx wwqgtxx merged commit 613becd into MetaCubeX:Alpha Dec 9, 2024
@enfein enfein deleted the mieru2 branch December 9, 2024 04:08
JeelsBoobz added a commit to JeelsBoobz/mihomo that referenced this pull request Dec 9, 2024
@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Dec 9, 2024

We found a problem. After mihomo released v1.19.0, many embedded users requested to exclude mieru due to the greatly increased binary size.

As the conclusion of the investigation, github.com/enfein/mieru/v3/apis/client should not rely on the top-level package github.com/enfein/mieru/v3/pkg/appctl. In fact, client only calls appctl's FlatPortBindings and ValidateClientConfigSingleProfile, but this will force downstream projects to rely on the complete google.golang.org/grpc and increase the binary size by about 7mb on mainstream platforms.

In mihomo's use case, it makes no sense to include the google.golang.org/grpc, but the import of the top-level package of appctl causes the golang compiler to be unable to determine that this part of the code is unreachable. In a personal test, moving these two functions to a separate subpackage and only importing this subpackage in the client can make mihomo no longer rely on google.golang.org/grpc after executing go mod tidy, and greatly reduce the compilation size.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants