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

Custom directives: Question #2939

Closed
tonykiselis opened this issue Jun 2, 2019 · 2 comments
Closed

Custom directives: Question #2939

tonykiselis opened this issue Jun 2, 2019 · 2 comments

Comments

@tonykiselis
Copy link

I've read through the documentation but haven't managed to find anything useful. What I wish to accomplish is to add additional logic to the compiler before the components are compiled.

The use case I'm trying to achieve is to allow declarative specification of grid position from outside the component. The compiler should parse these instructions and when adjust the specific components styles based on "props" which are not dynamic. The specific idea is to allow easy use of grid row / column without having to create multiple components for each possible combination.

I've checked through the compilers API, but ... well, I couldn't deduct anything which may aid my use case. AST returns just source string I don't really understand.

Can someone point me to how I may start approaching this issue. Is it even possible given current compiler's API?

@pngwn
Copy link
Member

pngwn commented Jun 3, 2019

The compiler is not currently pluginable and custom directives are not supported.

I'm not 100% sure on what you are trying to do so I can't comment on it's feasibility but there is currently no API to change compiler behaviour. Anything that cannot be done in a preprocessor, or using svelte's current component API is probably not going to work.

@Conduitry
Copy link
Member

As @pngwn noted, the compiler is not currently pluginizable, and is unlikely to become so, beyond that which is already afforded by preprocessors.

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

3 participants