justrhysism / storybook-framework-template-engine

Storybook framework for templating engines
7 stars 0 forks source link

Saving a template does not Hot Module Reload #2

Open justrhysism opened 2 years ago

doctyper commented 2 years ago

Hi @justrhysism! I know it's been a while, but I'm using your engine to build our internal component library, and this would be my most requested feature. Any chance of this feature being added?

justrhysism commented 2 years ago

Hi @doctyper, which bundler are you using? Using Vite I've had success leveraging this: https://www.npmjs.com/package/vite-plugin-full-reload

It's not HMR, but I've found it's fast enough in most cases.

Otherwise I haven't been able to find a way to make it "native" to the engine.

doctyper commented 2 years ago

@justrhysism We're using Webpack, and yeah I haven't found a way to HMR templates yet. I did come across this repo which does hot reload liquid templates, so I'm trying to decipher how exactly it's done and maybe port it over.

justrhysism commented 2 years ago

@doctyper I can't remember if Storybook exposes access to the Webpack Dev Server config, but that's where I'd probably try to hook in a watcher which just triggers a reload.

I have been looking at the Storybook HTML framework which has some evidence of page reloading, but I haven't been able to get it working.