outpostHQ / numl

Atomic UI Framework based on Web Components and Runtime CSS Generation for rapidly building interfaces that follow your Design System 🌈
https://numl.design
MIT License
337 stars 16 forks source link

Numl NPM package has "svelte" as a dependency #54

Closed andrey-skl closed 4 years ago

andrey-skl commented 4 years ago

Looks like numl doesn't work on top of svelte. Is svelte a runtime dependency? https://github.com/tenphi/numl/blob/master/package.json#L18

tenphi commented 4 years ago

Hi! Numl has the component subsystem based on Behaviors. Currently, it supports only Svelte.

The subsystem allows to include Rich components (as DatePicker) inside Numl elements. This feature is experimental.

There are three components in the Numl right now: 1) Debugger (nu-debug) 2) DatePicker (nu-datepicker) also it's a DateRangePicker if you add mode="range". It's broken in Storybook, cause Parcel can't build a stable version of it on the Preview Page. Webpack should work fine. https://numl.design/storybook/complex/localization 3) DateInput (nu-dateinput) – button wrapper around nu-datepicker.

All components (and behaviors) are loaded asynchronously and have almost zero impact on the overall size of the Core.

The component subsystem proved itself as very useful. So it's possible that it will be presented in the future versions of Numl.

andrey-skl commented 4 years ago

Okay, thank you for the detailed answer!

andrey-skl commented 4 years ago

@tenphi I've mad an experiment: I removed "svelte" folder from my node_modules, and <nu-datepicker mode="range">pick date</nu-datepicker> code still works.

Maybe svelte is built into Numl's dist files by rollup, and it is still no need to put anything in dependencies?

I've attached the minimal example: numl-without-svelte.zip

tenphi commented 4 years ago

Sorry, I was heedless and made a mistake. Svelte is not a runtime dependency. So yes, It can be moved to devDependencies as well as all other dependencies as they are compile-time dependencies. Is there any best practice for that?

andrey-skl commented 4 years ago

Thank you, I think it is a best practice to keep dev and compile-time deps under devDependencies and it should be enough, nothing else needed)

I just noticed this issue because when I tried Numl locally it was the only dependency I installed, and every it's sub dependency was easy to see.

Thank you!

tenphi commented 4 years ago

Done 👍 Thanks for your help!