-
-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Labels
enhancementNew feature or enhancementNew feature or enhancement
Milestone
Description
Currently, all the bindings and associated types from the C# solution are dumped to a single file (index.mjs
and bindings.g.d.ts
) and are grouped via TypeScript namespaces. This is sub-optimal for both the DX and performance.
For DX it's preferable to group the exports under sub-modules instead of TypeScript namespaces, so that they can be imported in a more granular way, eg:
import { doX, Enum } from "bootsharp/sharp-space-a";
import { doY } from "bootsharp/sharp-space-b";
if (enum === Enum.Foo) ...
doX();
doY();
— instead of the current:
import { SharpSpaceA, SharpSpaceB } from "bootsharp";
if (enum === SharpSpaceA.Enum.Foo) ...
SharpSpaceA.doX();
SharpSpaceB.doY();
Additionally, TypeScript namespaces usage is generally discouraged in favor of ES modules.
For performance, TypeScript compilers and linters prefer multiple smaller declaration files instead of a single large one. This also benefits tree shaking.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or enhancementNew feature or enhancement