Details
-
New Feature
-
Status: Closed
-
Normal
-
Resolution: Done
-
None
-
None
-
None
-
None
-
3
-
Tiger
-
Tiger Sprint 217, Tiger Sprint 218
Description
In the SPA code, this component should look something like:
import { BrPage, TYPE_CONTANER_BOX } from '@bloomreach/react-spa-sdk'; function App() { return ( <BrPage configuration={configuration} mapping={{ News: NewsComponent, [TYPE_CONTANER_BOX]: MainComponent }}> <header> <BrComponent path="header" /> <nav> <BrComponent path="menu" /> </nav> </header> <section> <nav class="sidenav"> <BrComponent path="sidebar" /> </nav> <div class="container"> <BrComponent> </div> </section> <footer> <BrComponent path="footer"> </footer> </BrPage> ); }
Requirements:
- Pass the configuration object as-is so we can refer to the documentation of the Shared SDK (and don't change the code if new options are being introduced).
- This should be mostly a wrapper around `initialize` call from the shared SDK.
- Use React's context API to pass the page model to BrComponent.
- Implement serialization and deserialization (hydrate) of the page model to support SSR.
- Implement HTML-comments rendering as a React component so we can reuse that internally later:
return ( <> { this.props.model.getMeta() .filter(meta => META_POSITION_BEGIN === meta.getPosition()) .map(meta => <Meta meta={meta} />) } </> );
Attachments
Issue Links
1.
|
Initialize the Page Model from the props | Closed | Unassigned | |
2.
|
Initialize the Page Model context | Closed | Unassigned | |
3.
|
Initialize mapping context | Closed | Unassigned | |
4.
|
Render HTML-comment with the page meta-data | Closed | Unassigned |