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

Alternate browser+server API #1

Open
wmertens opened this issue May 8, 2017 · 4 comments
Open

Alternate browser+server API #1

wmertens opened this issue May 8, 2017 · 4 comments

Comments

@wmertens
Copy link

wmertens commented May 8, 2017

Would it be possible to use the loader and svg-baker for something like the below?

<SymbolProvider>
    <App/>    // Use with e.g. <UseSymbol symbol={symbol}/>
    <svg>[...all currently-used symbols]</svg> // Gets added automatically, or maybe with another component
</SymbolProvider>

SymbolProvider would add context so that every <UseSymbol/> can register the id as being used.

This way, it also works with server-side rendering, even if multiple render simultaneously. The in-use symbols are all known by the time the svg with symbols renders.

@kisenka
Copy link
Contributor

kisenka commented May 8, 2017

Is this something you talking about in this issue JetBrains/svg-sprite-loader#45?

@wmertens
Copy link
Author

Right, I forgot about that one. I took a quick look and it seems to me that I need to make a custom runtime that doesn't do anything, and then just use the objects the loader returns?

@kisenka
Copy link
Contributor

kisenka commented May 12, 2017

Yes, but I don't understand your case entirely, could you describe by code what such runtime should do?

@wmertens
Copy link
Author

wmertens commented May 12, 2017 via email

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