-
-
Notifications
You must be signed in to change notification settings - Fork 131
☂️ Move to on-demand Windows API projection #819
Copy link
Copy link
Open
Labels
P3Low-priority issueLow-priority issueautomationReplace handcrafted code that doesn't scaleReplace handcrafted code that doesn't scaleepicA theme of work that contain sub-tasksA theme of work that contain sub-tasksfeatureA new feature or requestA new feature or requestpackage: generatorIssue with package:generatorIssue with package:generatorpackage: win32Issue with package:win32Issue with package:win32
Milestone
Metadata
Metadata
Assignees
Labels
P3Low-priority issueLow-priority issueautomationReplace handcrafted code that doesn't scaleReplace handcrafted code that doesn't scaleepicA theme of work that contain sub-tasksA theme of work that contain sub-tasksfeatureA new feature or requestA new feature or requestpackage: generatorIssue with package:generatorIssue with package:generatorpackage: win32Issue with package:win32Issue with package:win32
Background
package:win32currently ships a pre-generated subset of the Windows API, which covers many common use cases. However, this approach doesn't scale well — the Win32 API surface is enormous, and broadening coverage means unconditionally loading far more Dart code than most users will ever need, placing unnecessary strain on the Dart analyzer.Proposed Direction
Move to an on-demand projection model, similar to how
ffigenworks:package:win32is slimmed down to expose only a small core of helpers and runtime pieces.package:win32gen) accepts user input declaring which Win32 APIs they need, then emits only the corresponding Dart bindings into their project.Benefits
Original issue description
Currently, the JSON files define which APIs are projected by the generator.In a future major release (not inv6, likelyv7), I plan to expand thegeneratorto project nearly the entire Win32 API, excluding a few outdated APIs. This will be made possible by leveraging Microsoft’s metadata, eliminating the need for the manual effort currently required to add new APIs -- a process that is both time-consuming and tedious.The expanded scope will include:- Win32 callbacks- Win32 constants- Win32 enumerations- Win32 functions- Win32 structures- COM interfaces