Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@anywidget/svelte
Advanced tools
Svelte utilities for anywidget
Warning This API is currently experimental an subject to change.
npm install @anywidget/svelte
// index.js
import { createRender } from "@anywidget/svelte";
import Counter from "./Counter.svelte";
export let render = createRender(Counter);
<!-- Counter.svelte -->
<script>
import { stores } from "@anywidget/svelte";
// Access traitlet values as Svelte stores
let { count } = stores;
</script>
<button on:click={() => $count += 1}>Count is {$count}</button>
You'll need to compile the above source files into a single ESM entrypoint for anywidget with a bundler.
We currently recommend using Rollup.
pnpm add -D rollup @rollup/plugin-node-resolve rollup-plugin-svelte
// rollup.config.js
import svelte from "rollup-plugin-svelte";
import resolve from "@rollup/plugin-node-resolve";
export default {
input: "index.js",
output: "bundle.js",
plugins: [svelte({ emitCss: false }), resolve()],
};
rollup -c rollup.config.js --watch
Alternatively, you can use the anywidget Vite plugin.
pnpm add -D vite @sveltejs/vite-plugin-svelte @anywidget/vite
// vite.config.js
import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import anywidget from "@anywidget/vite";
export default defineConfig({
plugins: [anywidget(), svelte({ hot: false })],
});
vite
You can read more about using Vite with anywidget in our documentation.
Special thanks to Daria Vasyukova for the idea and Donny Bertucci for the initial implementation, which lead to this package.
MIT
FAQs
Svelte utilities for anywidget
The npm package @anywidget/svelte receives a total of 0 weekly downloads. As such, @anywidget/svelte popularity was classified as not popular.
We found that @anywidget/svelte demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.