-
Notifications
You must be signed in to change notification settings - Fork 4
Refactor Navigation Include to use ESI #4
Comments
The refactoring must consist into:
Up-coming questions / issues:
Pre-requisites:
|
actually comparing the original solution with the rendering directly in the |
I disagree. A third option could be to use a While I did not like the use of another "technology" at the beginning (introduce a new esi tag in the htl template), I now like the fact that this makes transparent the fact that the nav is managed in an other markdown (fragment ?). |
i totally agree that separating concerns into the seperate resources is cleaner. your statement that the rendering code could be more complicated is absolutely correct, but it is not in this very example. as for ESI, in the case of the navigation that contains the same markup on all pages, one could argue that ESI is not the right solution either but instead it would be a separate resource (json, js, html, md?) that is requested directly from the client and therefore cached in the browser. of course i agree that there is a place for ESI (and client side includes and htl-includes), i just think that in this very example, it is a lot easier for someone who is new to the project to just have to understand how i think we have a tendency to over-engineer things because we are anticipating additional complexity and extension needs or we are striving for abstraction and with that make the initial learning curve steeper. |
@kptdobe, as i was reading #8, i just noticed that we possibly may have different goals for this example project. i think you are looking at this as a project to try out a variety of solutions for correctly anticipated real-life problems, and i am looking at it in a way where i think how can we keep it as simple as possible to show how little complexity you will need to master to get started. i think both goals are fine, and we should probably do both. maybe separately. |
Correct and I sensed that already ;) But my main goal is more to be... convinced and convincing. So I agree to have "master" branch for simplicity and other branch(es) for real-life approach Regarding ESI, I can revert the changes from master and move them to the "other" branch for now. I do not say ESI is THE solution but the previous code is pretty ugly (during the rendering of the md, it fetches the nav md, executes the lambda function to render it, computes some metadata you do not need... not so simple and smart). |
As agreed, I reverted the changes: the "nav" is generated via code in the See commit: dbbef1e |
Still WIP: moving code to new "experiments" branch |
i think things are slightly different here than they were, in two ways:
i completely agree with you on the question of the code being maintainable, and i don't know a more real-world project would yield a different code organization, but i would like to make sure that we keep simple projects simple and provide the necessary means, for a bigger more complex project to modularize things as needed. |
See https://github.com/adobe/helix-helpx/pull/3/files#r194838365 – note that this depends on adobe/project-helix#171
The text was updated successfully, but these errors were encountered: