retejs / context-menu-plugin

https://retejs.org
MIT License
11 stars 43 forks source link

No more Pug #26

Closed mrauhu closed 1 year ago

mrauhu commented 5 years ago

Hello, Vitaliy.

I'm removed the Pug support.

Now you can import this plugin directly into your Vue app (with SASS compiler):

import ContextMenuPlugin from 'rete-context-menu-plugin/src';

Import size of:

Best regards, Sergey.

P.S. Also includes changes from #25

Ni55aN commented 5 years ago

Now you can import this plugin directly into your Vue app

This is not good solution because Babel will not transpile the code in node_modules. For example, the script in /src with async/await it will not be built or will be built as is (I do not remember exactly)

Ni55aN commented 5 years ago

I'm removed the Pug support.

I like working with pug more than with pure html :)

mrauhu commented 5 years ago

rete-context-menu-plugin/src

This is not good solution because Babel will not transpile the code in node_modules. For example, the script in /src with async/await it will not be built or will be built as is (I do not remember exactly)

I'm using it in Vue project created with Vue CLI 3 (Babel and Webpack) — all works, also with async/await.

Ni55aN commented 5 years ago

It may not work in other cases. Definitely it will not work in a browser without a build system

mrauhu commented 5 years ago

I like working with pug more than with pure html :)

@Ni55aN adding Pug for 20 lines of code?

Ni55aN commented 5 years ago

@mrauhu why not? There may be more lines in the future, so the convenience of development has a higher priority than premature optimization for me

mrauhu commented 5 years ago

@Ni55aN

Before: https://bundlephobia.com/result?p=rete-context-menu-plugin@0.5.0

52 kB MINIFIED + GZIPPED

After my premature optimizations:

5.94 KB (gzipped and minified);

Ten times less.

mrauhu commented 5 years ago

After my premature optimizations and dangerous tree-shaking using the import from rete-context-menu-plugin/src (kids, don't try this at home):

2.54 KB (gzipped and minified).

20 times less.