Socket
Socket
Sign inDemoInstall

vue

Package Overview
Dependencies
19
Maintainers
2
Versions
497
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.2.47 to 3.3.2

compiler-sfc/register-ts.js

2

compiler-sfc/index.js
module.exports = require('@vue/compiler-sfc')
require('./register-ts.js')

2

compiler-sfc/package.json

@@ -5,2 +5,2 @@ {

"types": "index.d.ts"
}
}

@@ -22,54 +22,49 @@ 'use strict';

// This entry is the "full-build" that includes both the runtime
const compileCache = Object.create(null);
const compileCache = /* @__PURE__ */ Object.create(null);
function compileToFunction(template, options) {
if (!shared.isString(template)) {
if (template.nodeType) {
template = template.innerHTML;
}
else {
runtimeDom.warn(`invalid template option: `, template);
return shared.NOOP;
}
if (!shared.isString(template)) {
if (template.nodeType) {
template = template.innerHTML;
} else {
runtimeDom.warn(`invalid template option: `, template);
return shared.NOOP;
}
const key = template;
const cached = compileCache[key];
if (cached) {
return cached;
}
const key = template;
const cached = compileCache[key];
if (cached) {
return cached;
}
if (template[0] === "#") {
const el = document.querySelector(template);
if (!el) {
runtimeDom.warn(`Template element not found or is empty: ${template}`);
}
if (template[0] === '#') {
const el = document.querySelector(template);
if (!el) {
runtimeDom.warn(`Template element not found or is empty: ${template}`);
}
// __UNSAFE__
// Reason: potential execution of JS expressions in in-DOM template.
// The user must make sure the in-DOM template is trusted. If it's rendered
// by the server, the template should not contain any user data.
template = el ? el.innerHTML : ``;
}
const opts = shared.extend({
hoistStatic: true,
onError: onError ,
onWarn: e => onError(e, true)
}, options);
if (!opts.isCustomElement && typeof customElements !== 'undefined') {
opts.isCustomElement = tag => !!customElements.get(tag);
}
const { code } = compilerDom.compile(template, opts);
function onError(err, asWarning = false) {
const message = asWarning
? err.message
: `Template compilation error: ${err.message}`;
const codeFrame = err.loc &&
shared.generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);
runtimeDom.warn(codeFrame ? `${message}\n${codeFrame}` : message);
}
// The wildcard import results in a huge object with every export
// with keys that cannot be mangled, and can be quite heavy size-wise.
// In the global build we know `Vue` is available globally so we can avoid
// the wildcard object.
const render = (new Function('Vue', code)(runtimeDom__namespace));
render._rc = true;
return (compileCache[key] = render);
template = el ? el.innerHTML : ``;
}
const opts = shared.extend(
{
hoistStatic: true,
onError: onError ,
onWarn: (e) => onError(e, true)
},
options
);
if (!opts.isCustomElement && typeof customElements !== "undefined") {
opts.isCustomElement = (tag) => !!customElements.get(tag);
}
const { code } = compilerDom.compile(template, opts);
function onError(err, asWarning = false) {
const message = asWarning ? err.message : `Template compilation error: ${err.message}`;
const codeFrame = err.loc && shared.generateCodeFrame(
template,
err.loc.start.offset,
err.loc.end.offset
);
runtimeDom.warn(codeFrame ? `${message}
${codeFrame}` : message);
}
const render = new Function("Vue", code)(runtimeDom__namespace);
render._rc = true;
return compileCache[key] = render;
}

@@ -79,4 +74,4 @@ runtimeDom.registerRuntimeCompiler(compileToFunction);

exports.compile = compileToFunction;
Object.keys(runtimeDom).forEach(function(k) {
if (k !== 'default') exports[k] = runtimeDom[k];
Object.keys(runtimeDom).forEach(function (k) {
if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = runtimeDom[k];
});

@@ -22,42 +22,35 @@ 'use strict';

// This entry is the "full-build" that includes both the runtime
const compileCache = Object.create(null);
const compileCache = /* @__PURE__ */ Object.create(null);
function compileToFunction(template, options) {
if (!shared.isString(template)) {
if (template.nodeType) {
template = template.innerHTML;
}
else {
return shared.NOOP;
}
if (!shared.isString(template)) {
if (template.nodeType) {
template = template.innerHTML;
} else {
return shared.NOOP;
}
const key = template;
const cached = compileCache[key];
if (cached) {
return cached;
}
if (template[0] === '#') {
const el = document.querySelector(template);
// __UNSAFE__
// Reason: potential execution of JS expressions in in-DOM template.
// The user must make sure the in-DOM template is trusted. If it's rendered
// by the server, the template should not contain any user data.
template = el ? el.innerHTML : ``;
}
const opts = shared.extend({
hoistStatic: true,
onError: undefined,
onWarn: shared.NOOP
}, options);
if (!opts.isCustomElement && typeof customElements !== 'undefined') {
opts.isCustomElement = tag => !!customElements.get(tag);
}
const { code } = compilerDom.compile(template, opts);
// The wildcard import results in a huge object with every export
// with keys that cannot be mangled, and can be quite heavy size-wise.
// In the global build we know `Vue` is available globally so we can avoid
// the wildcard object.
const render = (new Function('Vue', code)(runtimeDom__namespace));
render._rc = true;
return (compileCache[key] = render);
}
const key = template;
const cached = compileCache[key];
if (cached) {
return cached;
}
if (template[0] === "#") {
const el = document.querySelector(template);
template = el ? el.innerHTML : ``;
}
const opts = shared.extend(
{
hoistStatic: true,
onError: void 0,
onWarn: shared.NOOP
},
options
);
if (!opts.isCustomElement && typeof customElements !== "undefined") {
opts.isCustomElement = (tag) => !!customElements.get(tag);
}
const { code } = compilerDom.compile(template, opts);
const render = new Function("Vue", code)(runtimeDom__namespace);
render._rc = true;
return compileCache[key] = render;
}

@@ -67,4 +60,4 @@ runtimeDom.registerRuntimeCompiler(compileToFunction);

exports.compile = compileToFunction;
Object.keys(runtimeDom).forEach(function(k) {
if (k !== 'default') exports[k] = runtimeDom[k];
Object.keys(runtimeDom).forEach(function (k) {
if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = runtimeDom[k];
});
import { CompilerOptions } from '@vue/compiler-dom';
import { RenderFunction } from '@vue/runtime-dom';
export * from '@vue/runtime-dom';
export declare function compile(template: string | HTMLElement, options?: CompilerOptions): RenderFunction;
export declare function compileToFunction(template: string | HTMLElement, options?: CompilerOptions): RenderFunction;
export * from "@vue/runtime-dom";
export { }
export { compileToFunction as compile };
// this is appended to the end of ../dist/vue.d.ts during build.
// imports the global JSX namespace registration for compat.
// TODO: remove in 3.4
import '../jsx'

@@ -8,62 +8,57 @@ import * as runtimeDom from '@vue/runtime-dom';

function initDev() {
{
initCustomFormatter();
}
{
initCustomFormatter();
}
}
// This entry is the "full-build" that includes both the runtime
if ((process.env.NODE_ENV !== 'production')) {
initDev();
if (process.env.NODE_ENV !== "production") {
initDev();
}
const compileCache = Object.create(null);
const compileCache = /* @__PURE__ */ Object.create(null);
function compileToFunction(template, options) {
if (!isString(template)) {
if (template.nodeType) {
template = template.innerHTML;
}
else {
(process.env.NODE_ENV !== 'production') && warn(`invalid template option: `, template);
return NOOP;
}
if (!isString(template)) {
if (template.nodeType) {
template = template.innerHTML;
} else {
process.env.NODE_ENV !== "production" && warn(`invalid template option: `, template);
return NOOP;
}
const key = template;
const cached = compileCache[key];
if (cached) {
return cached;
}
const key = template;
const cached = compileCache[key];
if (cached) {
return cached;
}
if (template[0] === "#") {
const el = document.querySelector(template);
if (process.env.NODE_ENV !== "production" && !el) {
warn(`Template element not found or is empty: ${template}`);
}
if (template[0] === '#') {
const el = document.querySelector(template);
if ((process.env.NODE_ENV !== 'production') && !el) {
warn(`Template element not found or is empty: ${template}`);
}
// __UNSAFE__
// Reason: potential execution of JS expressions in in-DOM template.
// The user must make sure the in-DOM template is trusted. If it's rendered
// by the server, the template should not contain any user data.
template = el ? el.innerHTML : ``;
}
const opts = extend({
hoistStatic: true,
onError: (process.env.NODE_ENV !== 'production') ? onError : undefined,
onWarn: (process.env.NODE_ENV !== 'production') ? e => onError(e, true) : NOOP
}, options);
if (!opts.isCustomElement && typeof customElements !== 'undefined') {
opts.isCustomElement = tag => !!customElements.get(tag);
}
const { code } = compile(template, opts);
function onError(err, asWarning = false) {
const message = asWarning
? err.message
: `Template compilation error: ${err.message}`;
const codeFrame = err.loc &&
generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);
warn(codeFrame ? `${message}\n${codeFrame}` : message);
}
// The wildcard import results in a huge object with every export
// with keys that cannot be mangled, and can be quite heavy size-wise.
// In the global build we know `Vue` is available globally so we can avoid
// the wildcard object.
const render = (new Function('Vue', code)(runtimeDom));
render._rc = true;
return (compileCache[key] = render);
template = el ? el.innerHTML : ``;
}
const opts = extend(
{
hoistStatic: true,
onError: process.env.NODE_ENV !== "production" ? onError : void 0,
onWarn: process.env.NODE_ENV !== "production" ? (e) => onError(e, true) : NOOP
},
options
);
if (!opts.isCustomElement && typeof customElements !== "undefined") {
opts.isCustomElement = (tag) => !!customElements.get(tag);
}
const { code } = compile(template, opts);
function onError(err, asWarning = false) {
const message = asWarning ? err.message : `Template compilation error: ${err.message}`;
const codeFrame = err.loc && generateCodeFrame(
template,
err.loc.start.offset,
err.loc.end.offset
);
warn(codeFrame ? `${message}
${codeFrame}` : message);
}
const render = new Function("Vue", code)(runtimeDom);
render._rc = true;
return compileCache[key] = render;
}

@@ -70,0 +65,0 @@ registerRuntimeCompiler(compileToFunction);

@@ -5,19 +5,19 @@ import { initCustomFormatter, warn } from '@vue/runtime-dom';

function initDev() {
{
initCustomFormatter();
}
{
initCustomFormatter();
}
}
// This entry exports the runtime only, and is built as
if ((process.env.NODE_ENV !== 'production')) {
initDev();
if (process.env.NODE_ENV !== "production") {
initDev();
}
const compile = () => {
if ((process.env.NODE_ENV !== 'production')) {
warn(`Runtime compilation is not supported in this build of Vue.` +
(` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
) /* should not happen */);
}
if (process.env.NODE_ENV !== "production") {
warn(
`Runtime compilation is not supported in this build of Vue.` + (` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".` )
/* should not happen */
);
}
};
export { compile };
{
"name": "vue",
"version": "3.2.47",
"version": "3.3.2",
"description": "The progressive JavaScript framework for building modern web UI.",

@@ -16,2 +16,4 @@ "main": "index.js",

"server-renderer",
"jsx-runtime",
"jsx.d.ts",
"macros.d.ts",

@@ -40,2 +42,13 @@ "macros-global.d.ts",

},
"./jsx-runtime": {
"types": "./jsx-runtime/index.d.ts",
"import": "./jsx-runtime/index.mjs",
"require": "./jsx-runtime/index.js"
},
"./jsx-dev-runtime": {
"types": "./jsx-runtime/index.d.ts",
"import": "./jsx-runtime/index.mjs",
"require": "./jsx-runtime/index.js"
},
"./jsx": "./jsx.d.ts",
"./dist/*": "./dist/*",

@@ -73,8 +86,8 @@ "./package.json": "./package.json",

"dependencies": {
"@vue/shared": "3.2.47",
"@vue/compiler-dom": "3.2.47",
"@vue/runtime-dom": "3.2.47",
"@vue/compiler-sfc": "3.2.47",
"@vue/server-renderer": "3.2.47"
"@vue/shared": "3.3.2",
"@vue/compiler-dom": "3.3.2",
"@vue/runtime-dom": "3.3.2",
"@vue/compiler-sfc": "3.3.2",
"@vue/server-renderer": "3.3.2"
}
}
}

@@ -1,2 +0,2 @@

// TODO deprecated file - to be removed when out of experimental
// TODO remove in 3.4
import './macros-global'

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc