New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

single-spa-vue

Package Overview
Dependencies
Maintainers
6
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

single-spa-vue - npm Package Compare versions

Comparing version 1.5.3-alpha.0 to 1.5.3

24

lib/single-spa-vue.js

@@ -73,9 +73,11 @@ (function (global, factory) {

return Promise.resolve().then(function () {
if (props.domElement && !opts.appOptions.el) {
opts.appOptions.el = props.domElement;
var appOptions = _objectSpread({}, opts.appOptions);
if (props.domElement && !appOptions.el) {
appOptions.el = props.domElement;
}
if (!opts.appOptions.el) {
if (!appOptions.el) {
var htmlId = "single-spa-application:".concat(props.name);
opts.appOptions.el = "#".concat(htmlId.replace(':', '\\:'));
appOptions.el = "#".concat(htmlId.replace(':', '\\:'));
var domEl = document.getElementById(htmlId);

@@ -90,6 +92,4 @@

console.log(opts.appOptions.render, opts.appOptions.template, opts.rootComponent);
if (!opts.appOptions.render && !opts.appOptions.template && opts.rootComponent) {
opts.appOptions.render = function (h) {
if (!appOptions.render && !appOptions.template && opts.rootComponent) {
appOptions.render = function (h) {
return h(opts.rootComponent);

@@ -99,8 +99,8 @@ };

if (!opts.appOptions.data) {
opts.appOptions.data = {};
if (!appOptions.data) {
appOptions.data = {};
}
opts.appOptions.data = _objectSpread({}, opts.appOptions.data, {}, props);
mountedInstances.instance = new opts.Vue(opts.appOptions);
appOptions.data = _objectSpread({}, appOptions.data, {}, props);
mountedInstances.instance = new opts.Vue(appOptions);

@@ -107,0 +107,0 @@ if (mountedInstances.instance.bind) {

{
"name": "single-spa-vue",
"version": "1.5.3-alpha.0",
"version": "1.5.3",
"description": "a single-spa plugin for vue.js applications",

@@ -5,0 +5,0 @@ "main": "lib/single-spa-vue.js",

# single-spa-vuejs
[![Build Status](https://travis-ci.org/CanopyTax/single-spa-vue.svg?branch=master)](https://travis-ci.org/CanopyTax/single-spa-vue)

@@ -3,0 +4,0 @@ Generic lifecycle hooks for Vue.js applications that are registered as [applications](https://github.com/CanopyTax/single-spa/blob/master/docs/applications.md#registered-applications) of [single-spa](https://github.com/CanopyTax/single-spa).

@@ -49,9 +49,10 @@ const defaultOpts = {

.then(() => {
if (props.domElement && !opts.appOptions.el) {
opts.appOptions.el = props.domElement;
const appOptions = {...opts.appOptions}
if (props.domElement && !appOptions.el) {
appOptions.el = props.domElement;
}
if (!opts.appOptions.el) {
if (!appOptions.el) {
const htmlId = `single-spa-application:${props.name}`
opts.appOptions.el = `#${htmlId.replace(':', '\\:')}`
appOptions.el = `#${htmlId.replace(':', '\\:')}`
let domEl = document.getElementById(htmlId)

@@ -65,14 +66,13 @@ if (!domEl) {

console.log(opts.appOptions.render, opts.appOptions.template, opts.rootComponent)
if (!opts.appOptions.render && !opts.appOptions.template && opts.rootComponent) {
opts.appOptions.render = (h) => h(opts.rootComponent)
if (!appOptions.render && !appOptions.template && opts.rootComponent) {
appOptions.render = (h) => h(opts.rootComponent)
}
if (!opts.appOptions.data) {
opts.appOptions.data = {}
if (!appOptions.data) {
appOptions.data = {}
}
opts.appOptions.data = {...opts.appOptions.data, ...props}
appOptions.data = {...appOptions.data, ...props}
mountedInstances.instance = new opts.Vue(opts.appOptions);
mountedInstances.instance = new opts.Vue(appOptions);
if (mountedInstances.instance.bind) {

@@ -79,0 +79,0 @@ mountedInstances.instance = mountedInstances.instance.bind(mountedInstances.instance);

@@ -99,3 +99,5 @@ import singleSpaVue from './single-spa-vue'

return lifecycles.bootstrap(props).then(() => lifecycles.mount(props)).then(() => {
expect(Vue).toHaveBeenCalledWith(appOptions)
expect(Vue).toHaveBeenCalled()
expect(Vue.mock.calls[0][0].el).toBeTruthy()
expect(Vue.mock.calls[0][0].something).toBeTruthy()
return lifecycles.unmount(props)

@@ -124,2 +126,19 @@ })

})
it(`adds the single-spa props as data to the root component`, () => {
props.someCustomThing = 'hi'
const lifecycles = new singleSpaVue({
Vue,
appOptions: {},
})
return lifecycles.bootstrap(props).then(() => lifecycles.mount(props)).then(() => {
expect(Vue).toHaveBeenCalled()
expect(Vue.mock.calls[0][0].data).toBeTruthy()
expect(Vue.mock.calls[0][0].data.name).toBe('test-app')
expect(Vue.mock.calls[0][0].data.someCustomThing).toBe('hi')
return lifecycles.unmount(props)
})
})
})

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc