Content-Length: 289807 | pFad | https://github.com/flutter/flutter/issues/99412

06 Consider splitting generated Dart plugin registrant by platform · Issue #99412 · flutter/flutter · GitHub
Skip to content

Consider splitting generated Dart plugin registrant by platform #99412

@stuartmorgan-g

Description

@stuartmorgan-g

Currently for all platforms except web we are generating a single generated Dart plugin registrant file, with a bunch of Platform checks in it to decide what to register. This means that the Dart side of every platform's implementation is shipped to every platform (due to #14233). Ideally the tree shaking itself should be fixed, but absent that we may want to optimize this at the generated registrant level by having a different registration file for each platform.

The complexity here is that we currently don't have all the implementation we need at the compilation step to know what to target; we're currently using file existence, which is somewhat fragile, and wouldn't scale here. We'd need to figure out if we could plumb things all the way through to make sure we are using the correct file in each compilation invocation (even in complex scenarios like hot reload or hot restart when running simultaneously on multiple devices).

It may never be worth doing this, since the Dart side of plugins is probably not all that much code in the grand scheme of things, but filing for tracking to consolidate any discussion about this.

/cc @gaaclarke

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: pluginsSupport for writing, building, and running plugin packagesc: new featureNothing broken; request for a new capabilitycustomer: penguinteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/flutter/flutter/issues/99412

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy