Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dotwebstack/webcomponents

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dotwebstack/webcomponents

DotWebStack Web Components

  • 0.1.22
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-97.22%
Maintainers
2
Weekly downloads
 
Created
Source

DotWebStack Web Components

A set of embeddable Linked Data web components, built on React.

Build Status NPM (Scoped)

Prerequisites

The following tools are required:

Installation

These webcomponents can be installed using NPM:

npm install --save @dotwebstack/webcomponents @rdfjs/data-model

And of course, also with Yarn:

yarn add @dotwebstack/webcomponents @rdfjs/data-model

Documentation

Usage with React

Here is an example of using webcomponents within a React application:

import React from 'react';
import { GraphContext, Vocabulary } from '@dotwebstack/webcomponents';

const endpoint = 'https://bag.basisregistraties.overheid.nl/def/bag';

const App = () => (
  <GraphContext src={endpoint}>
    {(store) => (
      <Vocabulary store={store} />
    )}
  </GraphContext>
);

ReactDOM.render(<App />, document.getElementById('root'));

Usage without React

All components are also available by string reference to the renderComponent and createComponent methods. This makes it possible to use web components in a non-React application:

import { createComponent, renderComponent } from '@dotwebstack/webcomponents';

// Alternative method when not using ES6 modules:
// const namedNode = require('@rdfjs/data-model').namedNode;
// const renderComponent = require('@dotwebstack/webcomponents').renderComponent;
// const createComponent = require('@dotwebstack/webcomponents').renderComponent;

renderComponent(
  document.getElementById('root'),
  'GraphContext',
  {
    src: 'https://bag.basisregistraties.overheid.nl/def/bag',
    children: (store: any) => createComponent('Vocabulary', { store }),
  },
);

See the example folder for more configurations.

Development

Install dependencies:

npm install

Start development server:

npm run start

Release

Make sure to switch to the master branch first.

Prepare a new version (change update type to minor or major when relevant):

npm version patch

Push commit & tag:

git push origin master --tags

To publish the new version to the NPM registry:

npm publish

License

This project is published under the MIT License.

FAQs

Package last updated on 04 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc