You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d903ce5
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/api/component-library.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,8 @@ Client functions become element methods. Event directives accept a method name a
82
82
83
83
Client methods can explicitly import browser helpers from relative TypeScript modules or installed packages. Named, aliased, default, namespace and side-effect imports are resolved during the build, including their transitive dependencies. Type-only imports have no runtime effect. Helpers declare their own imports; no STX page globals are supplied by the custom-element host. Use `this` for per-element state, and `onConnect` / `onDisconnect` for setup and cleanup. Authored browser modules retain ordinary shared module identity across elements.
84
84
85
+
Imports resolve from the authored component's package, including browser export conditions and package import maps, even when `outputDir` is outside that package. Comments and import attributes retain their ordinary module meaning. `<script server>` blocks are excluded from the browser component graph and are not executed by the component-library compiler. Supply browser render values through properties or the component's default client script; server-only declarations are unavailable to the generated browser render.
86
+
85
87
Distribute the complete emitted directory, including any `chunks/` files. Both individual ESM entries and `bundle.js` work without the author's source tree. `bundle: false` disables only the standalone bundle; browser dependencies are still compiled into the ESM distribution. Server-only modules such as `node:fs` fail the browser build. Component metadata and SSR helper generation do not execute these browser dependencies.
86
88
87
89
Property types are `string`, `number`, `boolean`, `object`, and `array`. Properties reflect to kebab-case attributes by default. Use `"attribute": false` for property-only values, a string for a custom attribute name, or `"reflect": false` to accept attribute input without reflecting later property writes.
if(args.path==='bun'||args.path.startsWith('bun:')||args.path.startsWith('node:')||SERVER_MODULES.has(args.path))thrownewError(`Server-only import ${JSON.stringify(args.path)} is not available in a browser component (${args.importer})`)
0 commit comments