-
Notifications
You must be signed in to change notification settings - Fork 8
Component #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Component #162
Conversation
4e97843 to
95711ec
Compare
|
This is unnecessary. Just use Example here: |
Thank you for your opinion, I disagree. Having it as a component just increases readability and is the more "proper way" to do it in my opinion. It doesn't matter anyways as the owner of the repo seems to be inactive, so this will never get merged anyways. |
|
Which you like more is of course going to be a personal opinion. I'm pointing out that the component is not necessary. Svelte can use vanillja js libraries just as is. In React and other frameworks you often have to create wrappers in order to get third party libraries to work properly (in React because of integration with hooks). Not so in Svelte. You can usually use the basic original example from the docs of the third party library directly in Svelte. In the case of ApexCharts we need to use This whole "just use third party libraries as is" thing got a lot of traction three months ago: I'm not cop telling you what the "proper way" is, but this is certainly the most direct way :) |
|
Can you use the vanilla JavaScript version of the ApexCharts in Svelte(Kit)? - Yes Does that mean component⋅helper⋅wrapper libraries should be criticized? - No Simple, no-dependency helper libraries all great if they are well maintained. I even created a HTML <dialog> wrapper component library which encapsulates the official Svelte modal example. Regarding the PR, I believe this can be a non-breaking change, since the component does not rely on SvelteKit APIs. Non top-level Wouldn't additional export be enough? // Existing Export
import { chart } from "svelte-apexcharts";
// Newly Added Export
import Chart from 'svelte-apexcharts/Chart.svelte';Notes:
|
Made this a component & made it use
svelte-kit packagefor TypeScript support, these changes are breaking.