outpostHQ/numl

Numl NPM package has "svelte" as a dependency

Closed this issue · 6 comments

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

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.

@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

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?

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!

Done 👍
Thanks for your help!