Skip to content
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

Suggestion: use "alias" so page source / example match usage #177

Closed
CaptainCodeman opened this issue Jun 2, 2024 · 8 comments
Closed

Comments

@CaptainCodeman
Copy link

CaptainCodeman commented Jun 2, 2024

The getting-started page explain how examples / page source will need different imports:

The page source will show:

import Chart, { Svg } from '$lib/components/Chart.svelte';
import Axis from '$lib/components/Axis.svelte';
import Bars from '$lib/components/Bars.svelte';

If you followed instructions to npm install layerchart your code should be:

import { Chart, Svg, Axis, Bars } from 'layerchart';

Using the alias configuration option would allow the internal code to import from 'layerchart' which might make things clearer / simpler.

BTW: excellent lib, just exploring it ...

@CaptainCodeman
Copy link
Author

Oh, maybe a duplicate of #108

@techniq
Copy link
Owner

techniq commented Jun 2, 2024

Thanks @CaptainCodeman. There has been some exploration in a PR and need to see if there is any performance regressions (that outweigh the benefits). Likely there will not be though.

@CaptainCodeman
Copy link
Author

Sorry for the noise, I should have looked first. I've never noticed any perf issue with that approach (although my libs tend to be smaller). AFAIK there are none and it's just a mapping done at the vite level.

@techniq
Copy link
Owner

techniq commented Jun 2, 2024

As soon as I wrap up the Brush component I'm going to use alias see how it goes. Will be a good improvement for examples and general development.

@techniq
Copy link
Owner

techniq commented Jun 2, 2024

and no worries about the noise, always nice to gauge interest to help set priorities.

@CaptainCodeman
Copy link
Author

Yeah, as someone new to the lib it was one thing that tripped me up a little. That and the tailwindcss custom colors that appear to depend on the ux lib.

@techniq
Copy link
Owner

techniq commented Jun 2, 2024

@CaptainCodeman Yeah, improving docs when not using Svelte UX (whether it's Skeleton, shadcn-svelte, standalone, etc) needs to be improved. Gathering notes in #160 to move to the docs once I get more fleshed out.

Also hoping to gather a lot of examples of various framework combinations to allow others to use as reference.

@techniq
Copy link
Owner

techniq commented Jun 12, 2024

@CaptainCodeman #192 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants