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

Edits to twig files included in parent do not appear until the parent file is updated #1015

Closed
a-fro opened this issue May 17, 2019 · 11 comments

Comments

@a-fro
Copy link

a-fro commented May 17, 2019

I am using Pattern Lab Node v3.0.0 on Mac, with Node v8.14.0, using the Twig Edition.

Expected Behavior

After running npm create pattern-lab and choosing the starterkit-twig-demo, I expect that while viewing a browser pages such as the comment thread in patternlab, I will see the page reload when I make changes to the included twig file (e.g. editing the 02-single-comment.twig file).

Actual Behavior

In order to see the changes, I have to edit 00-comment-thread.twig, which then shows changes to both the parent template and it's included child templates.

Steps to Reproduce
  1. clone and install pl
  2. Choose the twig edition and twig starterkit demo.
  3. Visit an organism in the browser, such as the comment thread.
  4. Make an edit to the 02-single-comment.twig file, which the comment thread includes.
  5. Notice that PL reloads, but changes do not appear.
  6. Edit 00-comment-thread.twig, and then both changes appear.
@nietzscheson
Copy link

I confirm this issue... It happens me exactly the same. I had to use node+mustache. Is very sad! 😞

@sghoweri
Copy link
Contributor

CC @EvanLovely 🤔

@EvanLovely
Copy link
Member

I feel like this has to do with the incremental rebuilds

@stale
Copy link

stale bot commented Jul 22, 2019

It's hard to keep track of everything. This issue has been automatically marked as stale because it has not had recent activity, neither from the team nor the community. It will be closed if no further activity occurs. Please consider adding additional info, volunteering to contribute a fix for this issue, or making a further case that this is important to you, the team, and the project as a whole. Thanks!

@a-fro
Copy link
Author

a-fro commented Jul 22, 2019

I'm happy to do some debugging if anyone can point me in the right direction.

@zhawkins
Copy link
Contributor

zhawkins commented Aug 6, 2019

This looks like it could be worked around if the cleanPublic config worked as expected. Meaning it would do a full rebuild if you changed a file vs an incremental build.

Looks like there are a couple of issues surrounding this issue.
#988 which has a PR: #989

#1024 is also related to cleanPublic not working.

@zhawkins
Copy link
Contributor

zhawkins commented Aug 6, 2019

As a follow up I used https://www.npmjs.com/package/patch-package to patch CLI and I can no longer reproduce the issue with cleanPublic set to true.

This doesn't solve the incremental build issue with nested templates but it helps me avoid the issue in the meantime. ¯_(ツ)_/¯

zhawkins pushed a commit to zhawkins/patternlab-node that referenced this issue Aug 20, 2019
Fixes issue where edits to twig files included in parent do not appear
until the parent file is updated.

Closes issue pattern-lab#1015
@zhawkins
Copy link
Contributor

@a-fro I've got a PR up that resolves this issue if you want to check it out #1036.

It's possible there's a better way to do this but it does work following your original testing instructions. I've also tested it on a project of ours where we were having the same issue.

@a-fro
Copy link
Author

a-fro commented Aug 27, 2019

@zhawkins thanks! Just back from vacation and will test this today on our project.

zhawkins pushed a commit to zhawkins/patternlab-node that referenced this issue Sep 9, 2019
Fixes issue where programmatically created twig includes would throw
a warning at compile time.

Closes issue pattern-lab#1015
@sghoweri
Copy link
Contributor

FYI, I merged in the fix for this yesterday + this was published to NPM ~6 hours ago!

@zhawkins
Copy link
Contributor

Thanks Salem!

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

No branches or pull requests

5 participants