-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embed growth chart client into mkdocs, remove iframe #91
Comments
Agreed. The iframe was always a bit of a hack really, it got the job done, but it affects zoom functionality. We also need to bring the codebase for the React client into the same repo as the MkDocs site. It'll result is a slightly more complex GitHub Action/workflow for build, but it'll be tidier and better integrated. Anyone fancy taking on this job? @anchit-chandran @dc2007git @eatyourpeas @chvanlennep? |
Process for direct implimentation of React Component into Material for MKDocs via <script> injectionRequirementsReact component ready for deployment ProcessPrepare React Component pre React 18
This process will create a folder named "build" in your React component directory
Prepare React Component React 18+React 18 changes the setup of a basic React component, moving the index.js to the 'src' folder, and replacing ReactDOM.render with ReactDOM.createROOT, regardless the document.getElementById("TAG") change will remain and this will be the key value to change.
Move React Component into MkDocs
Rendering a React component in Material for MkDocs
Component should now render in MkDocs. Notes/Bugs/Issues
|
This is very promising and might address the issue one of our implementers has using Coldfusion and cannot use NPM. Does this involve importing react, react-dom and babel in the head tag? |
So from how I understand it's working it doesn't need react, react-dom or babel in the head tags as I didn't include them in my demo build, and when you execute a 'run build' command it creates a javascript file that's designed to be read by webclients, so Babel is already used at that stage. The demo I setup on https://react-in-mkdocs-test.vercel.app/ was a React 17 project I built about a year ago, and but I've tested with a React 18 project as well, all be it a simple one. I can't conclusively say if how the React app is constructed is irrelvant, I think if code blocks are used and multiple js files are generated then more work will be required to see how they interact. It might be as simple as sequential script execution. As for ESM vs UMD I'd have to run some live test, but I don't think in principle any specific build style is required. |
I've raised rcpch/digital-growth-charts-react-component-library#135 to track the iframe build in the main repo as it could be a helpful way of integrating for some customers |
Need to build in the growth chart client into mkdocs. Iframe makes it difficult to zoom as confuses the action with scrolling
The text was updated successfully, but these errors were encountered: