{"bugs":{"url":"https://github.com/vuejs/core/issues"},"dist":{"shasum":"06429487e584838af81cd29b89d5fd16d0a41915","tarball":"https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.0-alpha.13.tgz","fileCount":5,"integrity":"sha512-ABb/ePb4rCRag4svghJMTkNCgwgIXq/AfLk73kOOLNxImgoMwZ/CoEjVGtsYm3eT7ZOnQShf2/56In74K0WmIw==","signatures":[{"sig":"MEYCIQDFSj//720nW0sRBZbsFcFNfuLn+LnNJJ3QfrSQCmEV9QIhAJwtyd7PHI1HpVZgiwliU/pnZToEKMNMYcaWzAs9ahA6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24182,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQTqdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpw1Q/5AIwdOnNMIKkU5FYSRM5F43IZLXDr+yMzrUahz5snYUO8WQo8\r\n8Vf52BQ6A1CzfOdTgi31LL/2/wETAiCCg/2ASliQFzyUcpxCbWa3/qnxXq+R\r\nEJMKqbtCstYqTL5go5UB7x+bD/A1jDbrJ/E/Ao8iUCJaSbz6f2WY8sKAHDHV\r\n3m2dNPIil4o5aniGWBE8c5oCy7RxcHg2BuNsRzZ8s3hdPLYmrCeXZQMCE+eP\r\nyVXgZbAkP2lmYV2POVEB2yfJLyH1iaKB1fkxsCuRJP2aPVxhNlMQmMZYTwo4\r\nuFwu7za7WVex/PhlS6eCQJGdcP1pJU2WW/AVqF+CdNhxM1P3b8x2TbQs2kns\r\nn+3bDLWHTitm/RhCv2wyxrNDpujWF9cwSQWTeM1xn3BnMwRy0G7c0zeUBcaS\r\nSPmuhVIMfpLNXOTMKsTArCN31nGN3Jq6RQaCDHSZ4ro/3Ir3XGpN7ZFodTUT\r\n1SWLzdBfOjZkKevCjLGnarGQ/pbQPbYsDjs0fU+qR4Q2j8QGAonRjZ5pNy2z\r\nysO5iNIXuNzmPmR5j42CvSrFdeRHFS4/+jrTwbU6cNiXh2gsXDZ+iPzgWWc9\r\nNJPywnSBj46pTk1RGyKTcuFUNW++ENkMgkmDJTPHRbZjvfNng/KecttmyYuD\r\nzXAO6NGBWOHVRV4t+PQF0XRaJGmRSZjdlbI=\r\n=USgZ\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":"5cdaac25909b9f943abbeb5fcfc9f5f0398269bd","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-alpha.13","magic-string":"^0.30.0","@babel/parser":"^7.20.15","estree-walker":"^2.0.2","@vue/compiler-core":"3.3.0-alpha.13"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@babel/core":"^7.21.3","@babel/types":"^7.21.3"},"_npmOperationalInternal":{"tmp":"tmp/reactivity-transform_3.3.0-alpha.13_1681996445800_0.43781998831803204","host":"s3://npm-registry-packages"},"_id":"@vue/reactivity-transform@3.3.0-alpha.13","version":"3.3.0-alpha.13"}