sketch-import-symbols
sketch-import-symbols copied to clipboard
Swapping symbols
Hi there,
Any chance to see this swapping symbols when an existing symbol is updated? I'm willing to help on building an open-source version of this.
Hi @florianpnn! Yes, I've actually been working on a solution that caters to this requirement, but it's been a little slow as have been busy with my day job the past couple of months - def keen on collaboration - how would you like to discuss further?
@kmerc Let's jump on a call, it will save us time. Hit me at florian(dot)peninon(at)gmail(dot)com so we can schedule it.
I thought about coding something like that but I am glad someone already did.
The only issue I faced so far is that it doesn't play along with nested symbols.
Does the latest update to the plugin (https://github.com/kmerc/sketch-import-symbols/pull/10) solve your issue?
@drewloomer Not really. When I import nested symbols the internal linking between them is gone.


I just ran a test on this. The issue appears to be with symbols that have /
in the name. As long as the name doesn't have a slash nested symbols appear to get updated correctly.
Actually that may not be accurate. I seem to have actually encountered this issue when I changed the name of a symbol. If a symbol is renamed, even Import by ID seems to fail on nested symbols.
cc: @drewloomer
I've been doing some digging on this and don't have a good fix. When importing symbols from another document, nested symbols lose their reference to their symbol master. The current code tries to get around this by looking for symbols with the same name as the instance, but that's obviously really fragile. @yourfavorite asked me to look into this further but I think it may require a pretty significant effort (if it's possible at all). I can try to work on this over the next few weeks but really don't have an ETA for a resolution. Sorry, guys.
Thanks for taking a look @drewloomer. Do you have any more details you could share on what the issue is? I'm going to try reaching out to the sketch team and see if they have an idea on how we could solve this.
I did some thinking on this @yourfavorite, and there may be an alternate way to approach what I was trying yesterday. I'll try to work on it over the weekend or early next week and get back to you. The bug may lie in my thinking, not the Sketch API.
@yourfavorite Finally got around to trying to make this work. I've submitted a PR that I think does the trick: https://github.com/kmerc/sketch-import-symbols/pull/16.
This issue is resolved in PR #16