Skip to content

Full HMR for .liquid files #24

@felixmosh

Description

@felixmosh

I'm opening this issue in order to make an organized place for the idea described here.

The idea is divided into several phases:

1. HMR of native html

  1. Create a dev only entry point which will load all .liquid files and pass them when ever they change as a string
  2. Wrap each file with a start & end unique html comment
  3. When an hot update comes replace the HTML between the special comments

2. Manipulate .liquide files locally

  1. Add support for Shopify only tags such as (schema, section etc... ) - probably will require some PRs to https://github.com/harttle/liquidjs-section-tags
  2. Manipulate {{ 'bundle.x.js' | asset_url | script_tags }} & {{ 'bundle.x.css' | asset_url | stylesheet_tags }} the same way it is handled in the CopyAssets task
  3. Prefetch store data to provide it to local .liquid renders

I've finished phase 1 🎊,
wFIbPrvOgJ

In this screenshot, you can see that whenever I edit message.liquid it hot replaced in the DOM without page reload!
As you can see it has un-processed liquid tags (Phase 2)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions