bootsharp icon indicating copy to clipboard operation
bootsharp copied to clipboard

Consolidate namespace override mechanism

Open elringus opened this issue 2 years ago • 0 comments

Currently, it's required to apply [JSNamespace] attribute to each assembly that has JS bindings and to the entry assembly.

That is because source generator gets the attribute from the assembly it's currently generating code for:

https://github.com/Elringus/DotNetJS/blob/cad9a87854fd860203d25991a55bb3a68fa11229/DotNet/Generator/GeneratedMethod.cs#L32

While packer gets the attribute from the entry assembly and applies the rules for all the other assemblies:

https://github.com/Elringus/DotNetJS/blob/cad9a87854fd860203d25991a55bb3a68fa11229/DotNet/Packer/PublishDotNetJS.cs#L64

Ideally, we have to find a way to make generator get the attribute from the entry assembly (if that's possible) or make packer resolve the attributes for each assembly individually to at least prevent cases when generated C# bindings are not in sync with JS counterparts.

elringus avatar Apr 23 '22 22:04 elringus