[{"data":1,"prerenderedAt":414},["ShallowReactive",2],{"bml-reference-libraries":3},{"data":4,"body":5},{},{"type":6,"children":7},"root",[8,17,41,48,53,65,76,88,99,111,116,125,144,150,169,208,217,230,236,241,250,269,278,304,317,323,328,340,345,358,379,385,404,409],{"type":9,"tag":10,"props":11,"children":13},"element","h1",{"id":12},"compiled-bml-libraries",[14],{"type":15,"value":16},"text","Compiled BML libraries",{"type":9,"tag":18,"props":19,"children":20},"p",{},[21,23,30,32,39],{"type":15,"value":22},"BML libraries package reusable components with their compiled Kotlin, client code, styles, assets\nand public types. Applications consume their binary dependencies; original sources are attachments\nfor editing and navigation. The ",{"type":9,"tag":24,"props":25,"children":27},"a",{"href":26},"\u002Fbml-reference\u002Fdesign-library",[28],{"type":15,"value":29},"Bosca Design Library",{"type":15,"value":31}," supplies shared\nweb components through ",{"type":9,"tag":33,"props":34,"children":36},"code",{"className":35},"",[37],{"type":15,"value":38},"io.bosca:bml-design",{"type":15,"value":40},".",{"type":9,"tag":42,"props":43,"children":45},"h2",{"id":44},"consume-a-library",[46],{"type":15,"value":47},"Consume a library",{"type":9,"tag":18,"props":49,"children":50},{},[51],{"type":15,"value":52},"Declare the Gradle dependency using the version selected for the application:",{"type":9,"tag":54,"props":55,"children":60},"pre",{"className":56,"code":58,"filename":-1,"highlights":-1,"language":59,"meta":35},[57],"language-kotlin","dependencies {\n    implementation(\"com.example:widgets:$widgetsVersion\")\n}\n","kotlin",[61],{"type":9,"tag":33,"props":62,"children":63},{"__ignoreMap":35},[64],{"type":15,"value":58},{"type":9,"tag":18,"props":66,"children":67},{},[68,70,75],{"type":15,"value":69},"Use the configured Bosca artifact repository for Bosca libraries and select an available release\nwith matching BML tooling. Within the Bosca workspace, the Design Library dependency is\n",{"type":9,"tag":33,"props":71,"children":72},{"className":35},[73],{"type":15,"value":74},"implementation(project(\":bml:bml-design\"))",{"type":15,"value":40},{"type":9,"tag":18,"props":77,"children":78},{},[79,81,86],{"type":15,"value":80},"Create ",{"type":9,"tag":33,"props":82,"children":83},{"className":35},[84],{"type":15,"value":85},"src\u002Fmain\u002Fbml\u002Fimports.bml",{"type":15,"value":87}," once:",{"type":9,"tag":54,"props":89,"children":94},{"className":90,"code":92,"filename":-1,"highlights":-1,"language":93,"meta":35},[91],"language-bml","\u003Cimport library=\"com.example:widgets\" \u002F>\n","bml",[95],{"type":9,"tag":33,"props":96,"children":97},{"__ignoreMap":35},[98],{"type":15,"value":92},{"type":9,"tag":18,"props":100,"children":101},{},[102,104,109],{"type":15,"value":103},"Every page and local component under that BML source root, including nested directories, can use\nthe library's exported tags directly. An import names ",{"type":9,"tag":33,"props":105,"children":106},{"className":35},[107],{"type":15,"value":108},"group:artifact",{"type":15,"value":110},"; Gradle selects the version.\nAdding the dependency alone does not import its tags. The root imports file accepts imports,\ncomments and whitespace.",{"type":9,"tag":18,"props":112,"children":113},{},[114],{"type":15,"value":115},"A file can also declare a top-level import before its page or component. File-local imports combine\nwith root imports. For an optional alias:",{"type":9,"tag":54,"props":117,"children":120},{"className":118,"code":119,"filename":-1,"highlights":-1,"language":93,"meta":35},[91],"\u003Cimport library=\"com.example:widgets\" as=\"widgets\" \u002F>\n\u003Cpage route=\"\u002F\">\n  \u003Chtml lang=\"en\">\n    \u003Cbody>\u003Cwidgets:notice>Saved preferences\u003C\u002Fwidgets:notice>\u003C\u002Fbody>\n  \u003C\u002Fhtml>\n\u003C\u002Fpage>\n",[121],{"type":9,"tag":33,"props":122,"children":123},{"__ignoreMap":35},[124],{"type":15,"value":119},{"type":9,"tag":18,"props":126,"children":127},{},[128,130,135,137,142],{"type":15,"value":129},"An unaliased import exposes short tags such as ",{"type":9,"tag":33,"props":131,"children":132},{"className":35},[133],{"type":15,"value":134},"\u003Cnotice>",{"type":15,"value":136},". An aliased import exposes only qualified\ntags such as ",{"type":9,"tag":33,"props":138,"children":139},{"className":35},[140],{"type":15,"value":141},"\u003Cwidgets:notice>",{"type":15,"value":143},". Importing the same library both ways shares its component identity\nand assets; instances keep their ordinary independent state.",{"type":9,"tag":42,"props":145,"children":147},{"id":146},"names-and-native-elements",[148],{"type":15,"value":149},"Names and native elements",{"type":9,"tag":18,"props":151,"children":152},{},[153,155,160,162,167],{"type":15,"value":154},"Local components take precedence over unprefixed library exports. Two different unaliased libraries\nexporting the same tag produce a diagnostic; give one an alias. Imports expose only explicitly\nexported components, while private helper components remain part of the compiled implementation.\nProtected BML syntax such as ",{"type":9,"tag":33,"props":156,"children":157},{"className":35},[158],{"type":15,"value":159},"page",{"type":15,"value":161}," and ",{"type":9,"tag":33,"props":163,"children":164},{"className":35},[165],{"type":15,"value":166},"island",{"type":15,"value":168}," retains its meaning.",{"type":9,"tag":18,"props":170,"children":171},{},[172,174,179,181,186,188,193,195,199,201,206],{"type":15,"value":173},"An imported ",{"type":9,"tag":33,"props":175,"children":176},{"className":35},[177],{"type":15,"value":178},"button",{"type":15,"value":180}," replaces unqualified ",{"type":9,"tag":33,"props":182,"children":183},{"className":35},[184],{"type":15,"value":185},"\u003Cbutton>",{"type":15,"value":187}," calls. Use ",{"type":9,"tag":33,"props":189,"children":190},{"className":35},[191],{"type":15,"value":192},"\u003Chtml:button>",{"type":15,"value":194}," for the native\nelement, including inside a component that implements ",{"type":9,"tag":33,"props":196,"children":197},{"className":35},[198],{"type":15,"value":178},{"type":15,"value":200},". ",{"type":9,"tag":33,"props":202,"children":203},{"className":35},[204],{"type":15,"value":205},"svg:",{"type":15,"value":207}," likewise selects native SVG.\nFor example, after importing the Design Library:",{"type":9,"tag":54,"props":209,"children":212},{"className":210,"code":211,"filename":-1,"highlights":-1,"language":93,"meta":35},[91],"\u003Cbutton primary>Save\u003C\u002Fbutton>\n\u003Chtml:button type=\"button\">Native button\u003C\u002Fhtml:button>\n",[213],{"type":9,"tag":33,"props":214,"children":215},{"__ignoreMap":35},[216],{"type":15,"value":211},{"type":9,"tag":18,"props":218,"children":219},{},[220,222,228],{"type":15,"value":221},"Use ",{"type":9,"tag":24,"props":223,"children":225},{"href":224},"\u002Fbml-reference\u002Ftag-reference#forwarding-component-attributes",[226],{"type":15,"value":227},"attribute forwarding",{"type":15,"value":229}," to pass additional\nnative attributes through a component. Props, projected children and declarative events keep their\nBML contracts across the binary dependency.",{"type":9,"tag":42,"props":231,"children":233},{"id":232},"produce-a-library",[234],{"type":15,"value":235},"Produce a library",{"type":9,"tag":18,"props":237,"children":238},{},[239],{"type":15,"value":240},"Apply the BML Gradle plugin to a Kotlin library project and configure its public exports:",{"type":9,"tag":54,"props":242,"children":245},{"className":243,"code":244,"filename":-1,"highlights":-1,"language":59,"meta":35},[57],"bml {\n    packageName.set(\"example.widgets.generated\")\n    library {\n        exports.set(listOf(\"notice\"))\n    }\n}\n",[246],{"type":9,"tag":33,"props":247,"children":248},{"__ignoreMap":35},[249],{"type":15,"value":244},{"type":9,"tag":18,"props":251,"children":252},{},[253,255,260,262,267],{"type":15,"value":254},"The project's group and artifact name define its import identity. Put BML components under\n",{"type":9,"tag":33,"props":256,"children":257},{"className":35},[258],{"type":15,"value":259},"src\u002Fmain\u002Fbml",{"type":15,"value":261},", ordinary Kotlin in its Kotlin source set, and client assets under ",{"type":9,"tag":33,"props":263,"children":264},{"className":35},[265],{"type":15,"value":266},"src\u002Fmain\u002Fclient",{"type":15,"value":268},".\nFor example:",{"type":9,"tag":54,"props":270,"children":273},{"className":271,"code":272,"filename":-1,"highlights":-1,"language":93,"meta":35},[91],"\u003Ccomponent tag=\"notice\">\n  \u003Cp class=\"notice\" role=\"status\" {...attrs}>\u003Cslot \u002F>\u003C\u002Fp>\n\u003C\u002Fcomponent>\n",[274],{"type":9,"tag":33,"props":275,"children":276},{"__ignoreMap":35},[277],{"type":15,"value":272},{"type":9,"tag":18,"props":279,"children":280},{},[281,283,288,290,295,297,302],{"type":15,"value":282},"Keep routable pages, messages and the ",{"type":9,"tag":33,"props":284,"children":285},{"className":35},[286],{"type":15,"value":287},"application",{"type":15,"value":289}," plugin in a separate application project. The\nlibrary's binary JAR carries its compiled renderers, manifest and reachable client\u002Fresource\ncontracts. Its sources JAR includes original BML, Kotlin and authored client sources. Gradle's\n",{"type":9,"tag":33,"props":291,"children":292},{"className":35},[293],{"type":15,"value":294},"bmlValidateLibrary",{"type":15,"value":296}," checks the binary\u002Fsource contract and is wired into ",{"type":9,"tag":33,"props":298,"children":299},{"className":35},[300],{"type":15,"value":301},"check",{"type":15,"value":303}," and library JAR\nvalidation. Maven publication validation checks the actual publication archives as well.",{"type":9,"tag":18,"props":305,"children":306},{},[307,309,315],{"type":15,"value":308},"Applications use generated aggregate registries for their selected components and dependencies.\nBML Server composes those components and their ",{"type":9,"tag":24,"props":310,"children":312},{"href":311},"\u002Fbml-reference\u002Flibrary-providers",[313],{"type":15,"value":314},"library providers",{"type":15,"value":316},"; callers\ndo not manually register every imported renderer. The application owns its document, routes,\nauthentication, data, forms and actions.",{"type":9,"tag":42,"props":318,"children":320},{"id":319},"styles-assets-and-public-client-types",[321],{"type":15,"value":322},"Styles, assets and public client types",{"type":9,"tag":18,"props":324,"children":325},{},[326],{"type":15,"value":327},"Library styles and client assets participate in the existing BML asset pipeline. Component\nreachability selects implementation assets: importing the Design Library module does not add its\nsource viewer or JSON editor implementation to a page that only renders basic controls.\nFonts and resources are packaged and served from the consuming application's origin.",{"type":9,"tag":18,"props":329,"children":330},{},[331,333,338],{"type":15,"value":332},"When application code imports the same npm ESM dependencies as a compiled library, the bundler\ncan reuse the library's compiled modules. Reuse requires matching source bytes, package metadata,\nstatic dependency resolution and bundler version. Different versions or modified dependency graphs\nkeep their own implementations. Libraries remain self-contained for consumers without those npm\npackages. Pages without matching application dependencies retain their ordinary library entries.\nLibrary binaries retain environment conditions until the consuming build selects development or\nproduction behavior. Production emits one entry per page with content-hashed shared modules, so\ncommon engines download once across pages. A page still loads only its reachable components;\nthis adds no public helper imports or component props. ",{"type":9,"tag":33,"props":334,"children":335},{"className":35},[336],{"type":15,"value":337},"bmlMetrics",{"type":15,"value":339}," includes the entry's full static\nmodule closure in its first-load figures.",{"type":9,"tag":18,"props":341,"children":342},{},[343],{"type":15,"value":344},"Packaged asset responses use the indexed content digest for conditional requests before loading a\nbody. Response bytes are verified and cached within the active application generation; a reload\nuses its new inventory and cache. Unknown paths remain unavailable.",{"type":9,"tag":18,"props":346,"children":347},{},[348,350,356],{"type":15,"value":349},"The Design Library's ",{"type":9,"tag":24,"props":351,"children":353},{"href":352},"\u002Fbml-reference\u002Fdesign-tokens",[354],{"type":15,"value":355},"CSS variables",{"type":15,"value":357}," let applications set colors,\nfonts, spacing, radii, focus and editor presentation in their own CSS, globally or on a themed\ncontainer. The application still chooses its document font, reset and layout.",{"type":9,"tag":18,"props":359,"children":360},{},[361,363,369,371,377],{"type":15,"value":362},"Publish type-only client event contracts with ",{"type":9,"tag":24,"props":364,"children":366},{"href":365},"\u002Fbml-reference\u002Flibrary-client-types",[367],{"type":15,"value":368},"library client declarations",{"type":15,"value":370},".\nThe consuming linker extracts these declarations from the binary for TypeScript checks; a producer\ncheckout is unnecessary. Keep search and save transport in application adapters.\n",{"type":9,"tag":24,"props":372,"children":374},{"href":373},"\u002Fbml-reference\u002Flibrary-localization",[375],{"type":15,"value":376},"Library localization",{"type":15,"value":378}," contributes component strings to the consuming\napplication's existing catalog and locale policy.",{"type":9,"tag":42,"props":380,"children":382},{"id":381},"develop-and-navigate",[383],{"type":15,"value":384},"Develop and navigate",{"type":9,"tag":18,"props":386,"children":387},{},[388,390,395,397,403],{"type":15,"value":389},"Run the consuming application's ",{"type":9,"tag":33,"props":391,"children":392},{"className":35},[393],{"type":15,"value":394},"bmlDev",{"type":15,"value":396},". Editable direct and transitive BML project libraries\nparticipate in Gradle's input graph: Kotlin, BML, client helpers, CSS, resources, assets, exports and\nroot imports rebuild the consumer. Successful builds load a new generation in the running server;\nfailed builds leave the last good generation serving. Framework and ordinary JVM dependency\nchanges require a restart. See ",{"type":9,"tag":24,"props":398,"children":400},{"href":399},"\u002Fbml-reference\u002Fgetting-started#develop-with-hot-reload",[401],{"type":15,"value":402},"hot reload",{"type":15,"value":40},{"type":9,"tag":18,"props":405,"children":406},{},[407],{"type":15,"value":408},"The IntelliJ plugin combines root\u002Ffile-local imports with the current module's dependency\nmanifests. Component completion and Go to Declaration support short and aliased tags, including\nopening, closing and self-closing uses. Project dependencies navigate to original BML sources;\npublished dependencies use their own matching attached sources. Embedded Kotlin can navigate to\nthe library's original model source. Download matching sources through Gradle or attach them in\nProject Structure when the IDE reports they are missing or mismatched. Metadata completion remains\navailable without source attachments. Editing imports invalidates bindings without compiling the\nconsumer.",{"type":9,"tag":18,"props":410,"children":411},{},[412],{"type":15,"value":413},"Multiline component tags use the same gutter and Collapse\u002FExpand actions as native tags, including\nwhen viewing original BML in read-only library source archives.",1793227349723]