Closed mrauhu closed 1 year 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)
I'm removed the Pug support.
I like working with pug more than with pure html :)
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
withasync
/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
.
It may not work in other cases. Definitely it will not work in a browser without a build system
I like working with pug more than with pure html :)
@Ni55aN adding Pug for 20 lines of code?
@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
@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.
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.
Hello, Vitaliy.
I'm removed the Pug support.
Now you can import this plugin directly into your Vue app (with SASS compiler):
Import size of:
rete-context-menu-plugin
— 21.61 KB (parsed) or 5.94 KB (gzipped and minified);rete-context-menu-plugin/src
— 6.31 KB (parsed) or 2.54 KB (gzipped and minified).Best regards, Sergey.
P.S. Also includes changes from #25