{"bugs":{"url":"https://github.com/vuejs/core/issues"},"dist":{"shasum":"424a70d43fb4893131b2c1fba9a9e6806ebeabe0","tarball":"https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.0-beta.3.tgz","fileCount":5,"integrity":"sha512-aM3TgBca9QMMu/9B9ASRVvckeZpAdJO9nmQh5UCznhoDYjVxQPS+sCQvH6TLOjPB1MDQMVQYg4ZiPqfVVo7NbA==","signatures":[{"sig":"MEYCIQCnn/jvjf6NKFd6M0x/XrvmDU7QKOrFcte29uEmVE0tzQIhAPuiACDUs5yRNRkOGnoASg0mgo8S0ljlxAFOAppjetB5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkT0AVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBHhAAjDwNKDgaXm8RiNxx0nccacRcIt9scYY9Nz6fktt+vg5D5Bii\r\nApMU3hCRYUksk5KEqSDwL7eqyNkVOo0krxHQumx9w5Dm43GF4YBkOT+g3osS\r\ntpdwyyZQu7bBASaIGPnchObmaeefLavILM2VLIR4LKZeUCLoC3jbm9slIn9I\r\nUuGtWPnIJTtJuAEN6HBn+vxd3N8mEHIHag6sjVrRzi0q9nFQGNoGdUmGjidQ\r\n3C3Jwe2fWDHpBUAI7IIxE2IJ6LVP3RRw8PJIA+jdYpP/yzN6mn8ISf/udQ6q\r\nze9TxlfpdBytXB9SXR35qZZ4qCXsLFYzq3eKrDwPWuH3VejExqjW0TdeGtf/\r\nh3Fyrd7pfWZZ0tZJPzueSIX2aozW99vYeIVF4B5HzB5PHOjiQdeqOYi/3ofJ\r\nvuPlrrs86IXLN4brdLNneT5H2YudGP5WPnAgnLvQbPJw9efCuvj1VnPGoz/r\r\nQkaOxqNOvAtqdckvKgl0UflyIeJiTgpih35JVxKPWkGidze7z9sQ4dMvlDYn\r\nvI4Or+QI8j3/3dxCkyeJvhsQsDG0tkw/NpoegQsMd3I5HF2BvSIOgzounOcO\r\ng0G6ezonp2oR5qpDf6Q+rncJamDJIsbDF9AD1tHzWow66yQqQnVRchgtgCHt\r\n7Oo8UxHau5hJXpoKs2ek5LRsgjh5f4XIlCo=\r\n=H5qP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/reactivity-transform.cjs.js","name":"@vue/reactivity-transform","types":"dist/reactivity-transform.d.ts","author":{"name":"Evan You"},"readme":"# @vue/reactivity-transform\n\n> ⚠️ This is experimental and the proposal has been dropped.\n> The feature is now marked as deprecated and will be removed from Vue core\n> in 3.4.\n>\n> See reason for deprecation [here](https://github.com/vuejs/rfcs/discussions/369#discussioncomment-5059028).\n\n## Basic Rules\n\n- Ref-creating APIs have `$`-prefixed versions that create reactive variables instead. They also do not need to be explicitly imported. These include:\n  - `ref`\n  - `computed`\n  - `shallowRef`\n  - `customRef`\n  - `toRef`\n- `$()` can be used to destructure an object into reactive variables, or turn existing refs into reactive variables\n- `$$()` to \"escape\" the transform, which allows access to underlying refs\n\n```js\nimport { watchEffect } from 'vue'\n\n// bind ref as a variable\nlet count = $ref(0)\n\nwatchEffect(() => {\n  // no need for .value\n  console.log(count)\n})\n\n// assignments are reactive\ncount++\n\n// get the actual ref\nconsole.log($$(count)) // { value: 1 }\n```\n\nMacros can be optionally imported to make it more explicit:\n\n```js\n// not necessary, but also works\nimport { $, $ref } from 'vue/macros'\n\nlet count = $ref(0)\nconst { x, y } = $(useMouse())\n```\n\n### Global Types\n\nTo enable types for the macros globally, include the following in a `.d.ts` file:\n\n```ts\n/// <reference types=\"vue/macros-global\" />\n```\n\n## API\n\nThis 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.\n\n### `shouldTransform`\n\nCan be used to do a cheap check to determine whether full transform should be performed.\n\n```js\nimport { shouldTransform } from '@vue/reactivity-transform'\n\nshouldTransform(`let a = ref(0)`) // false\nshouldTransform(`let a = $ref(0)`) // true\n```\n\n### `transform`\n\n```js\nimport { transform } from '@vue/reactivity-transform'\n\nconst src = `let a = $ref(0); a++`\nconst {\n  code, // import { ref as _ref } from 'vue'; let a = (ref(0)); a.value++\"\n  map\n} = transform(src, {\n  filename: 'foo.ts',\n  sourceMap: true,\n\n  // @babel/parser plugins to enable.\n  // 'typescript' and 'jsx' will be auto-inferred from filename if provided,\n  // so in most cases explicit parserPlugins are not necessary\n  parserPlugins: [\n    /* ... */\n  ]\n})\n```\n\n**Options**\n\n```ts\ninterface RefTransformOptions {\n  filename?: string\n  sourceMap?: boolean // default: false\n  parserPlugins?: ParserPlugin[]\n  importHelpersFrom?: string // default: \"vue\"\n}\n```\n\n### `transformAST`\n\nTransform with an existing Babel AST + MagicString instance. This is used internally by `@vue/compiler-sfc` to avoid double parse/transform cost.\n\n```js\nimport { transformAST } from '@vue/reactivity-transform'\nimport { parse } from '@babel/parser'\nimport MagicString from 'magic-string'\n\nconst src = `let a = $ref(0); a++`\nconst ast = parse(src, { sourceType: 'module' })\nconst s = new MagicString(src)\n\nconst {\n  rootRefs, // ['a']\n  importedHelpers // ['ref']\n} = transformAST(ast, s)\n\nconsole.log(s.toString()) // let a = _ref(0); a.value++\n```\n","gitHead":"5d4c3c60a87fcf224e2ba4749889ce176e7aa7e5","license":"MIT","_npmUser":{"name":"yyx990803","email":"yyx990803@gmail.com"},"homepage":"https://github.com/vuejs/core/tree/dev/packages/reactivity-transform#readme","keywords":["vue"],"repository":{"url":"git+https://github.com/vuejs/core.git","type":"git","directory":"packages/reactivity-transform"},"_npmVersion":"9.3.1","description":"@vue/reactivity-transform","directories":{},"maintainers":[{"name":"yyx990803","email":"yyx990803@gmail.com"}],"_nodeVersion":"18.14.0","buildOptions":{"prod":false,"formats":["cjs"]},"dependencies":{"@vue/shared":"3.3.0-beta.3","magic-string":"^0.30.0","@babel/parser":"^7.20.15","estree-walker":"^2.0.2","@vue/compiler-core":"3.3.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@babel/core":"^7.21.3","@babel/types":"^7.21.3"},"_npmOperationalInternal":{"tmp":"tmp/reactivity-transform_3.3.0-beta.3_1682915349442_0.4316909977578034","host":"s3://npm-registry-packages"},"_id":"@vue/reactivity-transform@3.3.0-beta.3","version":"3.3.0-beta.3"}