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

feat(tools): Templates can be imported from node_modules/ #1860

Merged
merged 1 commit into from
Jun 24, 2020

Conversation

vladitasev
Copy link
Contributor

@vladitasev vladitasev commented Jun 23, 2020

This feature allows .hbs template authors to:

  • Import other .hbs files from anywhere in the local filesystem: path starting with . or ..
  • Import other .hbs files from node_modules/

Examples:
{{>include "./Popup.hbs"}}
{{>include "../my_partials/Header.hbs"}}
{{>include "@ui5/webcomponents/src/ListItem.hbs"}}

This will enable third party developers to extend our components and implement the partials.

For the purpose, we need to start shipping the src/ directory of main and fiori.

In addition, some parts of the hbs2lit and hbs2ui5 libs have been improved, most notably includesReplacer in order to be able to recursively parse include statements while simultaneously keeping track of the current relative path of the currently parsed file so that relative references inside it can work properly.

closes: #1859

@vladitasev vladitasev merged commit 6fa5847 into master Jun 24, 2020
@vladitasev vladitasev deleted the improve-replacer branch June 24, 2020 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow third parties to import our .hbs files and override the hooks
2 participants