Public Symbols
@nhtio/lucid-resourceful-vue-components/symbols
Low-level injection symbols and related validation/display types intended for advanced integrations. In most cases you should prefer the provided composables (useIoC, useScopedDisplay, useValidation, etc.). Reach for these exports only when you need to:
- Provide/override the IoC container in a non-standard mount environment.
- Manually inject a scoped display instance inside custom wrapper components.
- Bridge Resourceful Record or Record Form internals into deeply nested custom components without prop drilling.
- Access the Resourceful Record event bus consumer directly (advanced orchestration / testing).
When (not) to use them
Use symbols when constructor‑level or plugin‑level setup is required that composables cannot cover (e.g. SSR hydration, micro‑frontend shells, cross‑app portals). Avoid them for routine component logic—composables handle lifecycle scoping and future internal changes.
Injection Symbols
| Symbol | Purpose | Typical Provider | Fallback If Missing |
|---|---|---|---|
IoCSymbol | Root service container (i18n, http, cache, timezones, etc.) | Plugin install (createApp().use(...)) | Hard failure / undefined behavior |
ResourcefulIndexScopedDisplaySymbol | Display/orientation context for a single ResourcefulIndex instance | Internal mount of ResourcefulIndex | Not injected → responsive heuristics degrade |
ResourcefulRecordScopedDisplaySymbol | Display/orientation for ResourcefulRecord | ResourcefulRecord component | Similar orientation fallback |
ResourcefulRecordScopedBusConsumerSymbol | Event bus consumer for record form actions (submit, reset, setFieldValue, etc.) | ResourcefulRecord | Programmatic form control lost |
ResourcefulRecordFormScopedDisplaySymbol | Display scope for nested record form component | Record form wrapper | Layout decisions fall back to global display |
ResourcefulRecordFormScopedBusConsumerSymbol | Event bus consumer within form‑scoped context | Record form wrapper | Localized form event dispatch not available |
Related Types & Utilities
These are re-exported here for convenience when working with the above symbols.
InjectionKey— Vue DI key type.ScopedDisplayInstance,ScopedDisplayOrientation— Encapsulated viewport/orientation metrics for container‑scoped responsive logic.- Validation surface:
useValidation,ValidationProps,ValidationFieldBindings,VInputPublicProps,VFieldPublicProps,VeeValidateStateVInputProps,DefinedField,DataTypeOf,MaybePromise. ResourcefulRecordBusConsumer,ResourcefulRecordBusEventMap— Programmatic record form actions & events.
Example: Custom Plugin Override
Providing a custom IoC instance (SSR or multi‑tenant shell):
import { IoCSymbol } from '@nhtio/lucid-resourceful-vue-components/symbols'
import { createApp } from 'vue'
import App from './App.vue'
const app = createApp(App)
app.provide(IoCSymbol, myCustomIoc) // Advanced use: supply pre-wired services
app.mount('#app')Example: Access Record Bus Directly
import { ResourcefulRecordScopedBusConsumerSymbol } from '@nhtio/lucid-resourceful-vue-components/symbols'
import { inject } from 'vue'
const bus = inject(ResourcefulRecordScopedBusConsumerSymbol)
bus?.on('doFormSubmit', () => {
// instrumentation / analytics
})Cautions
- Symbols are internal contracts: minor version bumps may refine behavior (names will remain stable, but emitted event payloads could evolve). Prefer composables unless you truly need the raw channel.
- Avoid leaking injected instances across async boundaries that outlive component trees (retain weak references or clone data).
- Always null‑check injected symbols; consumer components may be rendered outside expected providers during tests.
For most consumers, the IoC and Components docs provide the higher-level extension points you need.