egoist / svg-to-vue-component

Transform SVG files into Vue SFC (with hot reloading and SVGO support)
MIT License
235 stars 18 forks source link

Lazy loading broken for SSR #15

Closed manniL closed 5 years ago

manniL commented 5 years ago

Heya!

Finally did the switch for https://github.com/Developmint/nuxt-svg-loader thanks to @wagerfield.

And something broke πŸ™ˆ πŸ˜›

I can't lazy-load components with it anymore on server-side: Repro: https://mj87xr1kyp.sse.codesandbox.io/

Somehow this happens only sometimes with just one lazyloaded SVG but always with 2+.

PS: This was/is possible with https://github.com/visualfanatic/vue-svg-loader.

image

manniL commented 5 years ago

Researched a bit and it could be an issue with template functional and Nuxt.

Would it be possible to move the things to a functional render function?

egoist commented 5 years ago

@manniL we could do that, but we need to add HMR support manually. (should be easy though.)

manniL commented 5 years ago

@egoist Awesome! A non-functional template would be fine too if that'd be easier.

egoist commented 5 years ago

@manniL yeah, from I've heard from Evan, we don't need functional components just for perf gains in Vue 3 either, I will update it to use stateful component πŸ‘ŒπŸ»

manniL commented 5 years ago

@egoist Heard that too πŸ™Š Many thanks! ☺️

egoist commented 5 years ago

:tada: This issue has been resolved in version 0.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: