{"id":20600752,"url":"https://github.com/maraf/sharpkit.unobtrusivefeatures","last_synced_at":"2026-04-25T03:14:33.324Z","repository":{"id":88302936,"uuid":"68201913","full_name":"maraf/SharpKit.UnobtrusiveFeatures","owner":"maraf","description":"Plugin for SharpKit with unobtrusive features","archived":false,"fork":false,"pushed_at":"2016-09-16T17:05:13.000Z","size":45,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-17T01:38:31.231Z","etag":null,"topics":["sharpkit"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maraf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-14T11:51:47.000Z","updated_at":"2019-01-04T22:50:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"3e3819c8-b829-4f3d-a6f2-beb3926a12e2","html_url":"https://github.com/maraf/SharpKit.UnobtrusiveFeatures","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maraf%2FSharpKit.UnobtrusiveFeatures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maraf%2FSharpKit.UnobtrusiveFeatures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maraf%2FSharpKit.UnobtrusiveFeatures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maraf%2FSharpKit.UnobtrusiveFeatures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maraf","download_url":"https://codeload.github.com/maraf/SharpKit.UnobtrusiveFeatures/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242240916,"owners_count":20095331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sharpkit"],"created_at":"2024-11-16T08:39:15.041Z","updated_at":"2026-04-25T03:14:23.278Z","avatar_url":"https://github.com/maraf.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UnobtrusiveFeatures\n\nThis repository contains plugin for [SharpKit](http://sharpkit.net) that enables export to javascript without referencing any SharpKit library. The goal behide is to have reference-clear projects, that are \"shared\" between server and client.\n\nWhen developing client-side only library, typically UI, there is no need for removing reference to SharpKit. But when such library is re-used in the server project, defining export in SharpKit standard way requires reference to SharpKit, and so requires distributing this library with the server application and also loading the assembly to the AppDomain.\n\n## How to integrate?\n\nAs other SharpKit plugins, copy released asemblies to the `C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\SharpKit\\5` and import SharpKit targets with plugin.\n\n```XML\n\u003cItemGroup\u003e\n    \u003cSkcPlugin Include=\"SharpKit.UnobtrusiveFeatures.Plugin, SharpKit.UnobtrusiveFeatures\"\u003e\n        \u003cInProject\u003efalse\u003c/InProject\u003e\n    \u003c/SkcPlugin\u003e\n\u003c/ItemGroup\u003e\n\u003cImport Project=\"$(MSBuildBinPath)\\SharpKit\\5\\SharpKit.Build.targets\" /\u003e\n```\n\n## Export\n\nWith the UnobtrusiveFeatures plugin there is only XML configuration file and build targets import in the csproj. No reference required for defining export to the javascript.\n\nThe configuration XML follows XSD and so VisualStudio offers intellisense for it. \n\n```XML\n\u003cUnobtrusiveFeatures xmlns=\"http://schemas.neptuo.com/xsd/sharpkit-unobtrusivefeatures.xsd\"\u003e\n    \u003cExport Filename=\"Neptuo.js\" FilenameFormat=\"~/bin/{0}\" /\u003e\n    \u003cNamespace Target=\"Neptuo.Compilers\" Export=\"False\" /\u003e\n    \u003cNamespace Target=\"Neptuo.Security.Cryptography\" Export=\"False\" /\u003e\n    \u003cNamespace Target=\"Neptuo.Threading\" Export=\"False\" /\u003e\n    \u003cType Target=\"Neptuo.Activators.DependencyServiceProvider\" Export=\"False\" /\u003e\n    \u003cType Target=\"Neptuo.CodeDom.Compiler.CsCodeDomCompiler\" Export=\"False\" /\u003e\n    \u003cType Target=\"Neptuo.Collections.Specialized.NameValueReadOnlyDictionary\" Export=\"False\" /\u003e\n\u003c/UnobtrusiveFeatures\u003e\n```\n\nAlso, the configuration files can hierarchically inherited. If the project directory is for example `D:\\Development\\Framework\\MyFramework\\src`, in every directory on the path can be configuration file, named `SharpKit.UnobtrusiveFeatures.xml` or as currenly exporting assembly, eg: `MyFramework.xml`, that can contain some properties. These file are then in-memory-merged into a single configuration during compilation.\n\nAlso, the `Filename` and `FilenameFormat` attributes of `Export` element can contain placeholder for assembly name. We can define single configuration file in the root of all development projects, define like:\n\n```XML\n\u003cUnobtrusiveFeatures xmlns=\"http://schemas.neptuo.com/xsd/sharpkit-unobtrusivefeatures.xsd\"\u003e\n    \u003cExport FilenameFormat=\"~/bin/{0}\" Filename=\"{AssemblyName}.js\" /\u003e\n\u003c/UnobtrusiveFeatures\u003e\n```\n\nAnd this configuration file will export every SharpKit-enabled project to the file named as assembly in the bin folder of the project.\n\nAdvanced export features:\n- _Export_ defines global export. With this element we can define fallback file and path format to export all types to.\n- _ExternalTypes_ can be used, when we want to export used attributes which are referenced from assemblies, that we don't have source files for. As SharpKit such attributes automatically ommits, we can override this behavior to include them in the compilation. Note: Only the use of attributes is compiled. We are responsible to provide javascript type defines ourselves.\n- _Namespace_ defines exporting rules to namespace and all subnamespaces. With this element we can exclude whole namespace or change target file name.\n- _Type_ defines exporting rules for concrete class, like using `JsTypeAttribute`.\n\n## Extended C# artifacts\n\nThe plugin also exports some C# artifacts that are not export the SharpKit it self. The first one is a `IsAbstract` flag, that contains information whether the class can be instantiated. \n\n```Javascript\nvar TestSharpKit$UI$Presenter = {\n    ...\n    IsAbstract: false,\n    ...\n}\n```\n\nThe second one is a list of constructors defined in the class. With this feature, we can simply build IoC container with constructor injection. The export looks like:\n\n```Javascript\nvar TestSharpKit$UI$Presenter = {\n    ...\n    ctors: [{\n        name: \"ctor\",\n        parameters: [\"TestSharpKit.UI.Views.MainView\"]\n    }],\n    ...\n}\n```\n\n# License\n\n[Apache 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaraf%2Fsharpkit.unobtrusivefeatures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaraf%2Fsharpkit.unobtrusivefeatures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaraf%2Fsharpkit.unobtrusivefeatures/lists"}