
Research
/Security News
Chrome and Firefox Extensions Posing as Free VPNs Add Clipboard Stealers via Malicious Updates
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.
@atom-vue/ref-transform
Advanced tools
⚠️ This is experimental and currently only provided for testing and feedback. It may break during patches or even be removed. Use at your own risk!
Follow https://github.com/vuejs/rfcs/discussions/369 for details and updates.
$() to turn refs into reative variables$$() to access the original refs from reative variablesimport { ref, watch } from 'vue'
// bind ref as a variable
let count = $(ref(0))
// no need for .value
console.log(count)
// get the actual ref
watch($$(count), c => console.log(`count changed to ${c}`))
// assignments are reactive
count++
A few commonly used APIs have shorthands (which also removes the need to import them):
$(ref(0)) -> $ref(0)$(computed(() => 123)) -> $computed(() => 123)$(shallowRef({})) -> $shallowRef({})This package is the lower-level transform that can be used standalone. Higher-level tooling (e.g. @vitejs/plugin-vue and vue-loader) will provide integration via options.
shouldTransformCan be used to do a cheap check to determine whether full transform should be performed.
import { shouldTransform } from '@vue/ref-transform'
shouldTransform(`let a = ref(0)`) // false
shouldTransform(`let a = $ref(0)`) // true
transformimport { transform } from '@vue/ref-transform'
const src = `let a = $ref(0); a++`
const {
code, // import { ref as _ref } from 'vue'; let a = (ref(0)); a.value++"
map
} = transform(src, {
filename: 'foo.ts',
sourceMap: true,
// @babel/parser plugins to enable.
// 'typescript' and 'jsx' will be auto-inferred from filename if provided,
// so in most cases explicit parserPlugins are not necessary
parserPlugins: [/* ... */]
})
Options
interface RefTransformOptions {
filename?: string
sourceMap?: boolean // default: false
parserPlugins?: ParserPlugin[]
importHelpersFrom?: string // default: "vue"
}
transformASTTransform with an existing Babel AST + MagicString instance. This is used internally by @vue/compiler-sfc to avoid double parse/transform cost.
import { transformAST } from '@vue/ref-transform'
import { parse } from '@babel/parser'
import MagicString from 'magic-string'
const src = `let a = $ref(0); a++`
const ast = parse(src, { sourceType: 'module' })
const s = new MagicString(src)
const {
rootVars, // ['a']
importedHelpers // ['ref']
} = transformAST(ast, s)
console.log(s.toString()) // let a = _ref(0); a.value++
FAQs
@vue/ref-transform
The npm package @atom-vue/ref-transform receives a total of 24 weekly downloads. As such, @atom-vue/ref-transform popularity was classified as not popular.
We found that @atom-vue/ref-transform demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.