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

Incremental Builds: Updating an individual pattern breaks viewall page rendering #586

Closed
bmuenzenmeyer opened this issue Jan 5, 2017 · 6 comments

Comments

@bmuenzenmeyer
Copy link
Member

I am using Pattern Lab Node v2.7.1-alpha on Windows, with Node v5.5.0, using the Gulp Edition.

Expected Behavior

With cleanPublic set to false, incremental build functionality should be enabled.

Altering one file, pattern1.mustache within _patterns/test/group1 should cause it to incrementall rebuild.
However, this update should be visible on any viewall page alongside its sibling patterns. (All other patterns should remain untouched, effectively)

Actual Behavior

Only the changed pattern is displayed on the view all page

Steps to Reproduce
  1. Download zip and place as only thing under source/_patterns/

test.zip

image

  1. gulp patternlab:serve

3 Witness all output or viewall-test-all output

image

  1. Change pattern2.mustache

  2. Witness bug

image

Workaround

When you want to view viewall pages again, delete the dependenyGraph.json file and public/patterns

@georgiee
Copy link

georgiee commented Jan 9, 2017

Just to raise awareness:
I am using Pattern Lab Node v2.7.1-alpha on OSX 10.12.2 with Node v7.0.0, using the Gulp Edition, cleanPublic = true and I get the very same error.

Reproducible by running patternlab:patternsonly which excludes any other source of error.
Unpredictable output. Sometimes compiles latest changed mustache file sometimes nothing.

Mentioned workaround works for me too.

@bmuenzenmeyer
Copy link
Member Author

@georgiee thanks for the report - a set of changes on the dev branch should have fixed the cleanPublic = true side of things, if you are clamoring for that fix

@georgiee
Copy link

Thanks for that quick response. I'm fine with the stable 2.6.2 for now. But I gave the dev branch a quick test anyway and it worked like promised. I love to see incremental builds finally coming to pattern lab. Thanks all your efforts.

@tburny
Copy link

tburny commented Jan 11, 2017

@georgiee patternlab:patternsonly should not rebuild the View all pages, but the patterns only. That said, you probably won't see any effect unless you view a single pattern in the browser only.

@tburny
Copy link

tburny commented Jan 13, 2017

The UI uses a plain mustache template (i.e. not a Pattern) via buildViewAllHtml() -> pattern_assembler.renderPattern(). In the elsebranch there it creates a new empty pattern with all patterns in a group (i.e.atoms) as partials. However patternPartialCodeis undefined for each pattern indata.partials`, thus there is no output.

patternPartialCode is set in patternlab.js:writePatternFiles. However this method is only called for changed patterns in incremental build mode.

@bmuenzenmeyer
Copy link
Member Author

Confirmed this is working now.

Will be doing one final run of some of this functionality and then releasing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants