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

Components with dot notation does not work #1701

Closed
N00nDay opened this issue Oct 22, 2022 · 1 comment
Closed

Components with dot notation does not work #1701

N00nDay opened this issue Oct 22, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@N00nDay
Copy link

N00nDay commented Oct 22, 2022

Describe the bug

I am building a svelte component library that utilizes dot notation for component composition. I have dot notation working as it should but when I type a . instead of showing only the possible child components it acts like I just typed a < and started a new tag. I have the following component:

import OriginalButton from './Button.svelte';
import Icon from './Icon.svelte';

const Button = OriginalButton as ButtonStatic;
Button.Icon = Icon;
Button.Leading = Icon;
Button.Trailing = Icon;

export default Button;

export interface ButtonStatic {
    new (...args: ConstructorParameters<typeof OriginalButton>): OriginalButton;
    Icon: typeof Icon;
    Leading: typeof Icon;
    Trailing: typeof Icon;
}

When I type <Button. I would like autocomplete/intellisense to show me Icon, Leading, or Trailing but instead it is showing me all available components.

bVFcL

Reproduction

Create a SvelteKit Project

npm create svelte@latest my-app
cd my-app
npm install

Install STWUI

npm i -D stwui

Install TailwindCSS

npx svelte-add@latest tailwindcss
npm install

Modily `tailwind.config.cjs

module.exports = {
	content: [
		'./src/**/*.{html,js,svelte,ts}',
		'./node_modules/stwui/**/*.{svelte,js,ts,html}
	],
	plugins: [
		require('@tailwindcss/forms'),
		require('stwui/plugin')
	],
	darkMode: 'class',
};
  • Open root +page.svelte
  • import { Button } from "stwui"
  • Type <Button.

Expected behaviour

The expected behavior is that only the child components Leading, Trailing, and Icon would be listed or at least at the top of the list.

System Info

  • OS: Mac
  • IDE: VSCode

Which package is the issue about?

No response

Additional Information, eg. Screenshots

No response

@N00nDay N00nDay added the bug Something isn't working label Oct 22, 2022
@jasonlyu123
Copy link
Member

Duplicate of #776. This is a limitation of our current approach. We won't be able to fix it until #1177 is merged or we find a reliable workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants