[{"data":1,"prerenderedAt":237},["ShallowReactive",2],{"bml-reference-library-providers":3},{"data":4,"body":5},{},{"type":6,"children":7},"root",[8,17,23,30,51,63,75,80,99,105,124,136,145,150,155,164,184,190,223,232],{"type":9,"tag":10,"props":11,"children":13},"element","h1",{"id":12},"library-providers",[14],{"type":15,"value":16},"text","Library providers",{"type":9,"tag":18,"props":19,"children":20},"p",{},[21],{"type":15,"value":22},"A component library can publish its Bosca DI registrar classes alongside its renderers. The\nconsumer compiler composes the registrars for the libraries actually used by its components,\nincluding transitive requirements. It generates direct constructor calls; the consumer does not\nscan source or classes and does not list individual library providers.",{"type":9,"tag":24,"props":25,"children":27},"h2",{"id":26},"producer-declaration",[28],{"type":15,"value":29},"Producer declaration",{"type":9,"tag":18,"props":31,"children":32},{},[33,35,42,44,49],{"type":15,"value":34},"Configure the existing DI and service KSP processors in the library. If their\n",{"type":9,"tag":36,"props":37,"children":39},"code",{"className":38},"",[40],{"type":15,"value":41},"ProviderRegistrarPrefix",{"type":15,"value":43}," is ",{"type":9,"tag":36,"props":45,"children":46},{"className":38},[47],{"type":15,"value":48},"Design",{"type":15,"value":50},", declare the resulting entry point in the BML library block:",{"type":9,"tag":52,"props":53,"children":58},"pre",{"className":54,"code":56,"filename":-1,"highlights":-1,"language":57,"meta":38},[55],"language-kotlin","ksp {\n    arg(\"ProviderRegistrarPrefix\", \"Design\")\n}\n\nbml {\n    packageName.set(\"example.design.generated\")\n    library {\n        exports.set(listOf(\"counter\", \"card\"))\n        providerRegistrars.set(listOf(\"bosca.di.DesignProviderRegistrar\"))\n    }\n}\n","kotlin",[59],{"type":9,"tag":36,"props":60,"children":61},{"__ignoreMap":38},[62],{"type":15,"value":56},{"type":9,"tag":18,"props":64,"children":65},{},[66,68,73],{"type":15,"value":67},"Entries name public, top-level classes implementing ",{"type":9,"tag":36,"props":69,"children":70},{"className":38},[71],{"type":15,"value":72},"bosca.di.ProviderRegistrar",{"type":15,"value":74}," with a public\nzero-argument constructor. Declare only registrars owned by this library. Its dependencies advertise\ntheir own registrars. Duplicate names within a declaration or across resolved libraries are errors.\nThe compiler checks constructor\u002Ftype access, and publication checks that the registrar classes are\npresent in the binary JAR.",{"type":9,"tag":18,"props":76,"children":77},{},[78],{"type":15,"value":79},"The library manifest uses format 5, including provider and localization contracts. Build libraries and consumers with matching\nBML tooling; earlier manifest formats are rejected before import resolution.",{"type":9,"tag":18,"props":81,"children":82},{},[83,85,90,92,97],{"type":15,"value":84},"Ordinary constructor-created models need no registrar. An injected model still uses the existing\n",{"type":9,"tag":36,"props":86,"children":87},{"className":38},[88],{"type":15,"value":89},"\u003Cinject>",{"type":15,"value":91}," or ",{"type":9,"tag":36,"props":93,"children":94},{"className":38},[95],{"type":15,"value":96},"\u003Cinject server>",{"type":15,"value":98}," declaration. Live state needs the model's compiled serialization\nsupport, just as a locally declared model does.",{"type":9,"tag":24,"props":100,"children":102},{"id":101},"bml-server-and-host-bindings",[103],{"type":15,"value":104},"BML Server and host bindings",{"type":9,"tag":18,"props":106,"children":107},{},[108,110,115,117,122],{"type":15,"value":109},"Generated application pages expose their library registrars to ",{"type":9,"tag":36,"props":111,"children":112},{"className":38},[113],{"type":15,"value":114},"BmlServer",{"type":15,"value":116},". During ",{"type":9,"tag":36,"props":118,"children":119},{"className":38},[120],{"type":15,"value":121},"install",{"type":15,"value":123},", the\nserver registers each registrar type once across all pages, before installing page routes. A library\nthat is imported but never used contributes no registrars. Multiple aliases and diamond dependencies\nshare the same producer entry points.",{"type":9,"tag":18,"props":125,"children":126},{},[127,129,134],{"type":15,"value":128},"The host supplies external services through the ordinary Bosca DI API. For example, if a library\nfactory depends on its ",{"type":9,"tag":36,"props":130,"children":131},{"className":38},[132],{"type":15,"value":133},"HostLabels",{"type":15,"value":135}," contract:",{"type":9,"tag":52,"props":137,"children":140},{"className":138,"code":139,"filename":-1,"highlights":-1,"language":57,"meta":38},[55],"val application = BoscaApplication(config)\nprovides\u003Cexample.design.HostLabels> { example.design.HostLabels { \"Application label\" } }\n\nval server = BmlServer(project, example.app.generated.BmlPages.all, port)\nserver.install(application)\n",[141],{"type":9,"tag":36,"props":142,"children":143},{"__ignoreMap":38},[144],{"type":15,"value":139},{"type":9,"tag":18,"props":146,"children":147},{},[148],{"type":15,"value":149},"Libraries should document their required external bindings and configuration. Missing bindings\nremain DI failures. A library registrar cannot silently replace a different host provider: ordinary\nduplicate-provider checks still apply.",{"type":9,"tag":18,"props":151,"children":152},{},[153],{"type":15,"value":154},"An intentional replacement belongs after library registration and before requests begin:",{"type":9,"tag":52,"props":156,"children":159},{"className":157,"code":158,"filename":-1,"highlights":-1,"language":57,"meta":38},[55],"server.install(application)\nprovides\u003Cexample.design.Counter>(overrideExisting = true) {\n    example.design.Counter(\"Application override\")\n}\n\u002F\u002F Start the application's listener after composing its bindings.\n",[160],{"type":9,"tag":36,"props":161,"children":162},{"__ignoreMap":38},[163],{"type":15,"value":158},{"type":9,"tag":18,"props":165,"children":166},{},[167,169,173,175,182],{"type":15,"value":168},"Hosts that need this ordering can use ",{"type":9,"tag":36,"props":170,"children":171},{"className":38},[172],{"type":15,"value":121},{"type":15,"value":174}," with their existing Bosca application\u002Flistener\nlifecycle. During a development hot swap, the server retains existing library registrar types and\ntheir singleton instances; newly introduced types register before the replacement pages become\nactive. Compiled BML library dependencies load with their consuming application's development\ngeneration; registrar types loaded with that generation register before its pages become active.\nChanges to framework or ordinary JVM dependencies in the parent loader require the normal\ndevelopment-server restart described in ",{"type":9,"tag":176,"props":177,"children":179},"a",{"href":178},"\u002Fbml-reference\u002Fgetting-started",[180],{"type":15,"value":181},"getting started",{"type":15,"value":183},".",{"type":9,"tag":24,"props":185,"children":187},{"id":186},"other-hosts",[188],{"type":15,"value":189},"Other hosts",{"type":9,"tag":18,"props":191,"children":192},{},[193,195,200,202,207,209,214,216,221],{"type":15,"value":194},"Every compiled module with library providers generates ",{"type":9,"tag":36,"props":196,"children":197},{"className":38},[198],{"type":15,"value":199},"BmlProviders",{"type":15,"value":201}," in its configured package.\nIt implements the existing ",{"type":9,"tag":36,"props":203,"children":204},{"className":38},[205],{"type":15,"value":206},"ProviderRegistrar",{"type":15,"value":208}," interface and exposes its dependency-ordered ",{"type":9,"tag":36,"props":210,"children":211},{"className":38},[212],{"type":15,"value":213},"all",{"type":15,"value":215},"\nlist. Standalone project generation, including ",{"type":9,"tag":36,"props":217,"children":218},{"className":38},[219],{"type":15,"value":220},"bosca bml compile --library",{"type":15,"value":222},", emits the same\naggregate when its dependencies declare providers. A custom rendering host can compose it once\nthrough the usual registration path:",{"type":9,"tag":52,"props":224,"children":227},{"className":225,"code":226,"filename":-1,"highlights":-1,"language":57,"meta":38},[55],"bosca.di.register(example.app.generated.BmlProviders)\n",[228],{"type":9,"tag":36,"props":229,"children":230},{"__ignoreMap":38},[231],{"type":15,"value":226},{"type":9,"tag":18,"props":233,"children":234},{},[235],{"type":15,"value":236},"Supply external bindings before resolving models and apply intentional overrides afterward. BML\nServer already performs this registration for its generated pages, so its host should use the\nserver installation path above.",1793227349724]