DEV Community

Discussion on: What was your win this week?

Collapse
 
bugmagnet profile image
Bruce Axtens

My win this week ... well, there were a couple ... but the one that's exciting me most at the moment, and which I will write about soon is figuring out how to load an entire dotnet assembly tree into ClearScript without having to include it in the solution.

So now I can create a folder somewhere, run

nuget install %1 -Framework net46 -Dependency Highest

where %1 resolves to, say, WordPressPCL, and watch all the related packages install. Once that's done I can create a WP.assemblylist file and put the aforementioned folder path in it on line 1 followed by the topmost DLL name on the second line, e.g.

C:\Packages\WordPressPcl
WordPressPCL.dll

When I run my ClearScript-enabled CLI, it loads WordPressPCL.DLL and all its dependencies into the JavaScript engine and lets me do stuff like

var client = new WP.WordPressPCL.WordPressClient("http://demo.wp-api.org/wp-json/");

I can see all kinds of possibilities for this to extend the reach of the CLI exe without amping up the size of the core EXE.