cmdk icon indicating copy to clipboard operation
cmdk copied to clipboard

Minify output better

Open pacocoursey opened this issue 3 years ago • 2 comments

The library size can be minified by mangling object properties like .filtered. I think https://github.com/vercel/swr uses some tricks for this, like exporting things from barrel files or using TS enums.

Also, we could consider splitting cmdk and cmdk/dialog so that the ~fairly large Radix Dialog dependency isn't an upfront cost. Though I'd imagine most people want to use this library in the context of a dialog.

pacocoursey avatar Jul 28 '22 23:07 pacocoursey

It also makes sense that some people may want to embed the command window inside a page. Separating the dialog module can give users more flexibility on choosing the command window container.

lilingxi01 avatar Aug 10 '22 16:08 lilingxi01

@lilingxi01 Command by default already gives you that flexibility. For example, you can put it inside a Popover.

pacocoursey avatar Aug 10 '22 19:08 pacocoursey

Why minify the output? I am trying to debug an issue and it's almost impossible because all variable names are minified

Minification should be responsability of the final bundler, not of the library

remorses avatar Dec 03 '23 14:12 remorses