Skip to content

Tree-shaking improvements #322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .size-limit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = [
{
path: 'dist/portal-vue.esm.js',
name: 'Total',
limit: '3 KB',
},
{
path: 'dist/portal-vue.esm.js',
name: 'Portal',
import: '{ Portal }',
limit: '2 KB',
},
{
path: 'dist/portal-vue.esm.js',
name: 'PortalTarget',
import: '{ PortalTarget }',
limit: '2 KB',
},
{
path: 'dist/portal-vue.esm.js',
name: 'MountingPortal',
import: '{ MountingPortal }',
limit: '2.5 KB',
},
{
path: 'dist/portal-vue.esm.js',
name: 'Wormhole',
import: '{ Wormhole }',
limit: '2 KB',
},
]
19 changes: 13 additions & 6 deletions dist/portal-vue.common.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/portal-vue.common.js.map

Large diffs are not rendered by default.

19 changes: 13 additions & 6 deletions dist/portal-vue.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/portal-vue.esm.js.map

Large diffs are not rendered by default.

19 changes: 13 additions & 6 deletions dist/portal-vue.umd.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/*!
* portal-vue © Thorsten Lünborg, 2019
* portal-vue © Thorsten Lünborg, 2021
*
* Version: 2.1.7
*
Expand Down Expand Up @@ -90,7 +90,9 @@
var transports = {};
var targets = {};
var sources = {};
var Wormhole = Vue.extend({
var Wormhole =
/* #__PURE__ */
Vue.extend({
data: function data() {
return {
transports: transports,
Expand Down Expand Up @@ -205,10 +207,13 @@
}
}
});
var wormhole = new Wormhole(transports);
var wormhole =
/* #__PURE__ */
new Wormhole(transports);

var _id = 1;
var Portal = Vue.extend({
var Portal = /* #__PURE__ */
Vue.extend({
name: 'portal',
props: {
disabled: {
Expand Down Expand Up @@ -323,7 +328,8 @@
}
});

var PortalTarget = Vue.extend({
var PortalTarget = /* #__PURE__ */
Vue.extend({
name: 'portalTarget',
props: {
multiple: {
Expand Down Expand Up @@ -440,7 +446,8 @@
var _id$1 = 0;
var portalProps = ['disabled', 'name', 'order', 'slim', 'slotProps', 'tag', 'to'];
var targetProps = ['multiple', 'transition'];
var MountingPortal = Vue.extend({
var MountingPortal = /* #__PURE__ */
Vue.extend({
name: 'MountingPortal',
inheritAttrs: false,
props: {
Expand Down
2 changes: 1 addition & 1 deletion dist/portal-vue.umd.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"minify": "minify dist/portal-vue.umd.js --out-file dist/portal-vue.umd.min.js",
"lint": "vue-cli-service lint",
"test": "yarn test:unit",
"test:unit": "vue-cli-service test:unit"
"test:unit": "vue-cli-service test:unit",
"size": "size-limit",
"tree-shake": "yarn agadoo"
},
"main": "dist/portal-vue.umd.js",
"module": "dist/portal-vue.esm.js",
Expand All @@ -37,6 +39,7 @@
"devDependencies": {
"@babel/runtime-corejs2": "^7.1.5",
"@linusborg/vue-ko-fi-button": "^0.1.0",
"@size-limit/preset-small-lib": "^4.9.1",
"@types/jest": "^23.1.4",
"@vue/cli-plugin-babel": "^3.1.0",
"@vue/cli-plugin-eslint": "^3.1.0",
Expand All @@ -46,6 +49,7 @@
"@vue/eslint-config-prettier": "^4.0.0",
"@vue/eslint-config-typescript": "^3.1.0",
"@vue/test-utils": "^1.0.0-beta.26",
"agadoo": "^2.0.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-minify": "^0.5.0",
Expand All @@ -66,6 +70,7 @@
"rollup-plugin-replace": "^2.1.0",
"rollup-plugin-typescript2": "^0.18.0",
"sass-loader": "^7.0.3",
"size-limit": "^4.9.1",
"ts-jest": "^23.0.0",
"typescript": "^3.0.0",
"vue": "^2.6.7",
Expand Down
2 changes: 1 addition & 1 deletion src/components/mounting-portal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const portalProps = [

const targetProps = ['multiple', 'transition']

export default (Vue as withPortalTarget).extend({
export default /* #__PURE__ */ (Vue as withPortalTarget).extend({
name: 'MountingPortal',
inheritAttrs: false,
props: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/portal-target.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Transport, PropWithComponent } from '../types'

import { wormhole } from '@/components/wormhole'

export default Vue.extend({
export default /* #__PURE__ */ Vue.extend({
name: 'portalTarget',
props: {
multiple: { type: Boolean, default: false },
Expand Down
2 changes: 1 addition & 1 deletion src/components/portal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { wormhole } from './wormhole'

let _id = 1

export default Vue.extend({
export default /* #__PURE__ */ Vue.extend({
name: 'portal',
props: {
disabled: { type: Boolean },
Expand Down
4 changes: 2 additions & 2 deletions src/components/wormhole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const transports: Transports = {}
const targets: VMRegister = {}
const sources: VMRegister = {}

export const Wormhole = Vue.extend({
export const Wormhole = /* #__PURE__ */ Vue.extend({
data: () => ({
transports,
targets,
Expand Down Expand Up @@ -112,5 +112,5 @@ export const Wormhole = Vue.extend({
},
})

const wormhole = new Wormhole(transports)
const wormhole = /* #__PURE__ */ new Wormhole(transports)
export { wormhole }
Loading