mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 13:42:20 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
22
web/node_modules/@babel/plugin-transform-react-pure-annotations/LICENSE
generated
vendored
Normal file
22
web/node_modules/@babel/plugin-transform-react-pure-annotations/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
65
web/node_modules/@babel/plugin-transform-react-pure-annotations/lib/index.js
generated
vendored
Normal file
65
web/node_modules/@babel/plugin-transform-react-pure-annotations/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1,65 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
||||
|
||||
var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure");
|
||||
|
||||
var _core = require("@babel/core");
|
||||
|
||||
const PURE_CALLS = new Map([["react", ["cloneElement", "createContext", "createElement", "createFactory", "createRef", "forwardRef", "isValidElement", "memo", "lazy"]], ["react-dom", ["createPortal"]]]);
|
||||
|
||||
var _default = (0, _helperPluginUtils.declare)(api => {
|
||||
api.assertVersion(7);
|
||||
return {
|
||||
name: "transform-react-pure-annotations",
|
||||
visitor: {
|
||||
CallExpression(path) {
|
||||
if (isReactCall(path)) {
|
||||
(0, _helperAnnotateAsPure.default)(path);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
exports.default = _default;
|
||||
|
||||
function isReactCall(path) {
|
||||
if (!_core.types.isMemberExpression(path.node.callee)) {
|
||||
const callee = path.get("callee");
|
||||
|
||||
for (const [module, methods] of PURE_CALLS) {
|
||||
for (const method of methods) {
|
||||
if (callee.referencesImport(module, method)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const [module, methods] of PURE_CALLS) {
|
||||
const object = path.get("callee.object");
|
||||
|
||||
if (object.referencesImport(module, "default") || object.referencesImport(module, "*")) {
|
||||
for (const method of methods) {
|
||||
if (_core.types.isIdentifier(path.node.callee.property, {
|
||||
name: method
|
||||
})) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
33
web/node_modules/@babel/plugin-transform-react-pure-annotations/package.json
generated
vendored
Normal file
33
web/node_modules/@babel/plugin-transform-react-pure-annotations/package.json
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"name": "@babel/plugin-transform-react-pure-annotations",
|
||||
"version": "7.14.5",
|
||||
"description": "Mark top-level React method calls as pure for tree shaking",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-plugin-transform-react-pure-annotations"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-annotate-as-pure": "^7.14.5",
|
||||
"@babel/helper-plugin-utils": "^7.14.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.14.5",
|
||||
"@babel/helper-plugin-test-runner": "7.14.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"author": "The Babel Team (https://babel.dev/team)"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue