Testing Mirador using React 17 #3768
Pinned
phil-plencner-hl
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The recent commits to the
masterbranch of Mirador include upgrades to React 17 (as part of this closed issue: #3601) .There has not been a tagged release with these changes yet. However, in an effort to test out the functionality with Harvard's new Viewer which leverages Mirador 3 I have created an instance of the Harvard Viewer on Github Pages using Mirador 3 and React 17. You can see a set of example objects that use that instance here:
https://harvard-lts.github.io/mps-viewer/gh-pages/
The branch in our repository which includes this work is here:
https://github.com/harvard-lts/mps-viewer/tree/pre-pre-release
What were the steps I took to get to this state?
miradorusingnpm uninstall miradorreactandreact-domto version 17 usingnpm install react@17.0.0 react-dom@17.0.0miradoron themasterbranch using the tarball url (See: https://www.pluralsight.com/guides/install-npm-packages-from-gitgithub) usingnpm install https://github.com/ProjectMirador/mirador/tarball/mastersrc/mirador.js: https://github.com/harvard-lts/mps-viewer/blob/pre-pre-release/src/mirador.js#L1C1-L9 and https://github.com/harvard-lts/mps-viewer/blob/pre-pre-release/src/mirador.js#L339-L347babel-plugin-react-html-attrdev-dependencyand added a.babelrcfile (https://github.com/harvard-lts/mps-viewer/blob/pre-pre-release/.babelrc) to squash invalid DOM property warnings usingnpm install --save-dev babel-plugin-react-html-attrmiradoris installed via the tarball it is not built. So I had to runnpm installandnpm run prepublishOnlyunder the/node_modules/mirador/folder for Webpack to successfully build. I added it as apostinstallscript to package.json. (See: https://stackoverflow.com/a/39307622): https://github.com/harvard-lts/mps-viewer/blob/pre-pre-release/package.json#L18jsx-runtime. The temporary fix is to add aliases to webpack.config.js. I believe this can be removed when we upgrade to React 18. (Discovered here: Bug: Cannot import 'react/jsx-runtime' from esm node/webpack 5 facebook/react#20235 (comment)): https://github.com/harvard-lts/mps-viewer/blob/pre-pre-release/webpack/webpack.config.js#L33-L38What needs to happen next?
miradorso we no longer need to build off of a tarball and build it manually in apostinstallscript.I encourage any thoughts, feedback or collaboration on this effort.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions