Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tettusud/svelte-wc-layercake

A sample repo to try to use layercake as web component
https://github.com/tettusud/svelte-wc-layercake

Last synced: 14 days ago
JSON representation

A sample repo to try to use layercake as web component

Awesome Lists containing this project

README

        

# Svelte Web component

1. Clone this repo and install dependencies

```
npm install
```

2. Run the application,

```
npm run dev
```

3. Access the application on the url displayed in the logs

# Explanation of the issue

Building a web component in Svelte, while importing third party libraries for example **layercake** .

As of now all components should have the tag,

```

```

Since we do not have control over external libraries to have this tag, there is no way to import/make use of some of the wonderful libraries like **layercake** in our custom component.

# This branch

You will get compilation error, **No custom element 'tag' option was specified**
```
bundles src/main.ts → public/build/bundle.js...
(!) Plugin svelte: No custom element 'tag' option was specified. To automatically register a custom element, specify a name with a hyphen in it, e.g. . To hide this warning, use
node_modules/layercake/src/LayerCake.svelte
1:
^
2: import { setContext } from 'svelte';
3: import { writable, derived } from 'svelte/store';
node_modules/layercake/src/layouts/Webgl.svelte
1: <script>
^
2: import { getContext, onMount, setContext } from 'svelte';
3: import { writable } from 'svelte/store';
node_modules/layercake/src/layouts/Svg.svelte
1: <script>
^
2: import { getContext } from 'svelte';
3:
node_modules/layercake/src/layouts/Canvas.svelte
1: <script>
^
2: import { getContext, onMount, setContext } from 'svelte';
3: import { writable } from 'svelte/store';
node_modules/layercake/src/layouts/ScaledSvg.svelte
1: <script>
^
2: import { getContext } from 'svelte';
3:
node_modules/layercake/src/layouts/Html.svelte
1: <script>
^
2: import { getContext } from 'svelte';
3:
(!) Circular dependencies
node_modules/d3-interpolate/src/value.js -> node_modules/d3-interpolate/src/array.js -> node_modules/d3-interpolate/src/value.js
node_modules/d3-interpolate/src/value.js -> node_modules/d3-interpolate/src/object.js -> node_modules/d3-interpolate/src/value.js
created public/build/bundle.js in 1.6s

```