Some pointers when transitioning from the HareScript Webdesign system to TypeScript page builders
General:
- pageBuilders take the role of WebDesigns
- bodyRenderer.renderer takes the role of bondyRenderer.objectName
- the content is rendered before the page is built, reversing HareScript's order.
- ie 'the static/dynamicpage cannot access the webdesign'.
Assets:
- avoid designroot/imgroot as they are specific to the selected webdesign and hurt component sharing. refer to
/.wh/mod/<module>/public(mapped tomod::<module>/public/) instead - replace
/.publisher/sd/<module>/example_sitepaths with/.wh/mod/<module>/public/too
Main witty:
- htmlhead & htmlbody components become the parameters to
req.render - drop
<meta name="viewport"from your head - modify req.pageMetaData.viewport if the defaults (width=device-width, initial-scale=1.0) aren't sufficient.
Automatic migrations:
- Update moduledefinition.xml and set
webhareversionto the highest version you can. Some of the conversions/cleanup below may pick better syntax if the required version is high enough wh devkit:es2tsconverts.esto.ts/.tsxfiles, adding eslint/typescript ignore directives where neededwh devkit:siteprl2ymlconverts XML to YML siteprofileswh devkit:cleanupmodulecleans up XML and old loadlibs. It's not directly useful for TypeScript but cleaning up before XML to YML conversions and committing that first may reduces clutter in the actual conversion.