You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.
For project organization, it would be useful to put the htl and js files in sub-directories below src. Although hlx build properly compiles them, they are then not detected by the template resolver.
since we don't have a concept to address components or the like, we could just flatten or prefix the directory to the selector.
1) flattened approach
src/
- html.htl
sub1/
- test_html.htl
so /index.test.html would use the sub1/test_html.htl
/index.sub2-test.html would use sub2/test_html.htl
/index.sub1.html would use sub1/html.htl
The prefixed approach has the advantage that the resolution is always deterministic, but has the disavantage, that you might end-up with 10 different html.htl in your editor.
The flattened approach is just much simpler, but bears the risk of non-deterministic resolution.
The text was updated successfully, but these errors were encountered:
I'm comfortable with Flattened but I think I'd prefer Prefixed.
With Prefixed, it's up to the architect at that point as to whether they want uniquely named files for the sake of IDE experience. But it makes it way clearer which files are being referenced in the source structure.
Couple of questions.
1. With Flattened, how would would this directory structure resolve?
For project organization, it would be useful to put the
htl
andjs
files in sub-directories belowsrc
. Althoughhlx build
properly compiles them, they are then not detected by the template resolver.since we don't have a concept to address components or the like, we could just flatten or prefix the directory to the selector.
1) flattened approach
so
/index.test.html
would use thesub1/test_html.htl
2) prefixed approach
/index.test.html
would fail/index.sub2-test.html
would usesub2/test_html.htl
/index.sub1.html
would usesub1/html.htl
The prefixed approach has the advantage that the resolution is always deterministic, but has the disavantage, that you might end-up with 10 different
html.htl
in your editor.The flattened approach is just much simpler, but bears the risk of non-deterministic resolution.
The text was updated successfully, but these errors were encountered: