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

Recursive partial include #157

Merged
merged 10 commits into from
Oct 6, 2015
Merged

Recursive partial include #157

merged 10 commits into from
Oct 6, 2015

Conversation

e2tha-e
Copy link
Contributor

@e2tha-e e2tha-e commented Oct 2, 2015

Ref issue #156
I think this is fairly well commented, but here's a general overview:

diveSync iterates through all pattern files once to populate the patternlab.patterns array. This is necessary because a recursive inclusion of partials requires that all partial patterns exist in that array. Prior to this pr, any attempt to include partials occurring later in alphanumeric order would fail and break patternlab, because the patternlab.patterns data that the include operation was looking for was non-existent.

Therefore, another diveSync operation is required to do the actual recursion. This second diveSync successfully populates the extendedTemplate properties because the template properties were previously populated for all partials in the previous diveSync operation.

Please review, comment, and merge.

@bmuenzenmeyer
Copy link
Member

Hi @e2tha-e this sounds like a welcome addition. I will certainly check it out - as it addresses a long-standing quirk/known issue.

@e2tha-e
Copy link
Contributor Author

e2tha-e commented Oct 3, 2015

@bmuenzenmeyer Please note the additional commits address some ordering and text-rendering concerns in the navbar.

  • Commits 9441cec and 9e1fc5d keep variants grouped with their respective parents by maintaining their order in the patternlab.patterns array as per the diveSync.
  • Commit 34793f5 allows patterns to include underscore-prefixed patterns, but does not display them in the UI. Previously, patternlab-node treated underscore-prefixed patterns as if they didn't exist.
  • Commit 0109d6e allows for naming subdirectories and pattern variants without numeric prefixes and with any number of hyphens.

These code changes were mostly within parts I already edited, so I felt they shouldn't be in another pr.

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

Successfully merging this pull request may close these issues.

None yet

2 participants