Minimal Solid data browser using solid-panes-jss with solid-oidc authentication
npm install solid-shimMinimal Solid data browser - a lightweight alternative to mashlib using the JSS authentication stack.
- Same interface as mashlib - Drop-in replacement for testing and migration
- @view support - Self-describing JSON-LD views (W3C proposal)
- Minimal authentication - Uses solid-oidc (~600 lines) instead of @inrupt/solid-client-authn-browser (~150KB)
- Lightweight - Smaller bundle size with fewer dependencies
``html
`
solid-shim supports the @view proposal for JSON-LD, allowing data to specify its own renderer.
`html
`
When renderView() is called, solid-shim:@view
1. Finds the JSON-LD on the page
2. Parses it into the RDF store
3. Loads the pane module from the URLrender(subject, context)
4. Calls the pane's function
`javascript`
solidShim.renderView({
target: '#myDiv', // Element or selector to render into
subject: '#me', // Subject ID to render (default: @id from JSON-LD)
fallbackPane: myPane // Pane to use if @view fails or is missing
})
Pane modules are ES modules with a render function:
`javascript`
export default {
name: 'person',
render(subject, context) {
const store = context.session.store
const div = document.createElement('div')
// ... render logic
return div
}
}
See the W3C proposal for more details.
solid-shim exposes the same globals as mashlib:
- $rdf - RDF library (rdflib)panes
- - Solid panes with runDataBrowser() functionSolidLogic
- - Authentication and store utilitiesSolidLogic.authn
- - Authentication logicSolidLogic.authSession
- - Session managementSolidLogic.store
- - RDF storeSolidLogic.solidLogicSingleton
- - Singleton instancesolidShim
- - @view renderersolidShim.renderView(options)
- - Render JSON-LD using @viewsolidShim.parseJsonLdToStore(jsonld, baseUri, store)
- - Parse JSON-LD into RDF storemashlib.versionInfo
- - Version information
`bash`
git clone https://github.com/JavaScriptSolidServer/solid-shim
cd solid-shim
npm install
npm start
`bash`
npm run build
```
solid-shim
├── solid-panes-jss (panes and UI components)
│ ├── solid-ui-jss (UI widgets)
│ │ └── solid-logic-jss (core logic)
│ │ └── solid-oidc (authentication)
│ └── various pane packages
└── rdflib (RDF processing)
This is a minimal alternative to SolidOS/mashlib using the JSS authentication stack:
- solid-oidc - Minimal Solid-OIDC client
- solid-logic-jss - Core logic with solid-oidc
- solid-ui-jss - UI widgets
- solid-panes-jss - Pane components
MIT