storybookjs / aem

Adobe Experience Manager Storybook app with events, knobs, docs, addons, and more
https://storybook-aem.netlify.com/
MIT License
33 stars 24 forks source link

Add resource resolver #8

Closed tripodsan closed 4 years ago

tripodsan commented 4 years ago

many components include sub-resources and render them via the resource type (eg list component). for the resource include to work correctly, a resource resolver that operates on mock repository content is needed.

also see https://sling.apache.org/documentation/the-sling-engine/resources.html

although we should not implement the entire sling resource API, some core concepts can be copied:

CodeByAlex commented 4 years ago

@tripodsan should this be a part of the htl engine or a separate library? - sounds useful enough to be used for other purposes

tripodsan commented 4 years ago

I don't think it should be part of the htl-engine...for now I would keep it in storybook aem to incubate and the maybe promote to it's own package.

jantimon commented 4 years ago

Hey @tripodsan

we have just implemented a working resource loader and have a running AEM / Storybook system.

Maybe I can setup a short call to can you some problems we faced e.g. https://github.com/adobe/htlengine/issues/146 and how we solved to get the following example to work in AEM and storybook:

<sly data-sly-resource="${'article-overview' @ resourceType='demo/components/demo/article-overview'}" />

By now the following directives are running side-by-side in AEM and Storybook (thanks to @adobe/htlengine):

You can contact me on twitter @jantimon if you like

CodeByAlex commented 4 years ago

@tripodsan Does this still need more work?

tripodsan commented 4 years ago

let's close it for now.