Today most of the native BoringSSL surface is reached indirectly through:
src/symbols.yaml
tool/generate_symbols_table.dart
src/symbols.generated.c
lib/src/boringssl/lookup/symbols.generated.dart
lib/src/boringssl/lookup/lookup.dart
lib/src/third_party/boringssl/generated_bindings.dart
The core pattern is:
- export one
webcrypto_lookup_symbol(index) function from src/webcrypto.c
- map symbol name -> enum -> index in Dart
- resolve function pointers at runtime
- call most of BoringSSL through
BoringSsl.fromLookup(lookup)
This solved symbol-conflict concerns, but it has some downsides:
- It hides actual symbol usage from the linker/toolchain.
- It makes native tree shaking / dead stripping much harder.
- It keeps a fair amount of custom codegen and symbol-table machinery alive.
- It makes the native interface harder to reason about than direct bindings.
The single generic lookup function likely makes tree shaking effectively impossible in the current shape.
Goal
Rework the FFI layer so that more of the native surface is explicit and direct.
Possible directions:
- move practical parts of the surface to direct
@Native(..., assetId: ...) bindings
- reduce dependence on
BoringSsl.fromLookup(lookup)
- keep wrapper/helper exports only where they are actually needed
- if symbol conflicts are still a concern, evaluate prefixing/renaming exported symbols instead of using a generic runtime lookup trampoline
Non-goals
This issue is not the full prebuilt-assets rollout and not the full static-linking/tree-shaking redesign. It is the architectural cleanup needed before those later steps.
Today most of the native BoringSSL surface is reached indirectly through:
src/symbols.yamltool/generate_symbols_table.dartsrc/symbols.generated.clib/src/boringssl/lookup/symbols.generated.dartlib/src/boringssl/lookup/lookup.dartlib/src/third_party/boringssl/generated_bindings.dartThe core pattern is:
webcrypto_lookup_symbol(index)function fromsrc/webcrypto.cBoringSsl.fromLookup(lookup)This solved symbol-conflict concerns, but it has some downsides:
The single generic lookup function likely makes tree shaking effectively impossible in the current shape.
Goal
Rework the FFI layer so that more of the native surface is explicit and direct.
Possible directions:
@Native(..., assetId: ...)bindingsBoringSsl.fromLookup(lookup)Non-goals
This issue is not the full prebuilt-assets rollout and not the full static-linking/tree-shaking redesign. It is the architectural cleanup needed before those later steps.