Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@vue/repl
Advanced tools
Changelog
Readme
Vue SFC REPL as a Vue 3 component.
Note: @vue/repl
>= 2 now supports Monaco Editor, but also requires explicitly passing in the editor to be used for tree-shaking.
Basic editing experience with no intellisense. Lighter weight, fewer network requests, better for embedding use cases.
<script setup>
import { Repl } from '@vue/repl'
import CodeMirror from '@vue/repl/codemirror-editor'
// import '@vue/repl/style.css'
// ^ no longer needed after 3.0
</script>
<template>
<Repl :editor="CodeMirror" />
</template>
With Volar support, autocomplete, type inference, and semantic highlighting. Heavier bundle, loads dts files from CDN, better for standalone use cases.
<script setup>
import { Repl } from '@vue/repl'
import Monaco from '@vue/repl/monaco-editor'
// import '@vue/repl/style.css'
// ^ no longer needed after 3.0
</script>
<template>
<Repl :editor="Monaco" />
</template>
Customize the behavior of the REPL by manually initializing the store.
<script setup>
import { watchEffect, ref } from 'vue'
import { Repl, useStore, useVueImportMap } from '@vue/repl'
import Monaco from '@vue/repl/monaco-editor'
// retrieve some configuration options from the URL
const query = new URLSearchParams(location.search)
const {
importMap: builtinImportMap,
vueVersion,
productionMode,
} = useVueImportMap({
// specify the default URL to import Vue runtime from in the sandbox
// default is the CDN link from jsdelivr.com with version matching Vue's version
// from peerDependency
runtimeDev: 'cdn link to vue.runtime.esm-browser.js',
runtimeProd: 'cdn link to vue.runtime.esm-browser.prod.js',
serverRenderer: 'cdn link to server-renderer.esm-browser.js',
})
const store = useStore(
{
// pre-set import map
builtinImportMap,
vueVersion,
// starts on the output pane (mobile only) if the URL has a showOutput query
showOutput: ref(query.has('showOutput')),
// starts on a different tab on the output pane if the URL has a outputMode query
// and default to the "preview" tab
outputMode: ref(query.get('outputMode') || 'preview'),
},
// initialize repl with previously serialized state
location.hash,
)
// persist state to URL hash
watchEffect(() => history.replaceState({}, '', store.serialize()))
// use a specific version of Vue
vueVersion.value = '3.2.8'
// production mode is enabled
productionMode.value = true
</script>
<template>
<Repl :store="store" :editor="Monaco" :showCompileOutput="true" />
</template>
FAQs
Vue component for editing Vue components
The npm package @vue/repl receives a total of 3,410 weekly downloads. As such, @vue/repl popularity was classified as popular.
We found that @vue/repl demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.