Install the arteigenschaften.ch frontend as a local app.
Why? Because FNS does not have access to modern browsers. It may also help speed things up on their relatively weak computers.
A tool to collect and work with attributes of species and habitats for any taxonomies (more).
electron is used to make the create-react-app locally installable.
Inspired by React Bits.
- Follow https://www.youtube.com/watch?v=JrARTsX2RM0, https://github.com/popupbits/react-electron
yarn add @heroku/foreman
, not foreman itself: That has unsolved issues.- Add
"extends": null
to the build key in package.json to solve another issue: electron-userland/electron-builder#2030 (comment) - Set graphQlUri to
https://arteigenschaften.ch/graphql
insrc/modules/graphQlUri
- Do not initiate activeNodeArray from pathname in index.js (as the inital pathname is a file url): uncomment that code.
- In getActiveNodeArrayFromPathname prepend:
.replace('/C:', '')
, so it ends up as:window.location.pathname.replace('/C:', '').replace('/', '')
- Do not dynamically load chunks, that leads to issues.
- Create separate readme
- Add app Icons(s)
- Maximize window
- Open links in Browser instead of new electron window?
- move all .graphql calls to gql`` (done)
- in ae2: update version in
package.json
andsrc/components/AppBar/MoreMenu.js
- switch to ae-electron
- package.json: replace dependencies and resolutions with values from ae2
- update version in
package.json
- delete:
- public
- src
- add from ae2:
- public
- src
- Do not initiate activeNodeArray from pathname in
index.js
(as the inital pathname is a file url): uncomment that code. - In
src/modules/getActiveNodeArrayFromPathname.js
prepend:.replace('/C:', '')
, so it ends up as:window.location.pathname.replace('/C:', '').replace('/', '')
- Set graphQlUri to
https://artdaten.ch/graphql
insrc/modules/graphQlUri
(for testing purposes) - Do not dynamically load chunks. Files:
src/components/App.js
src/components/AppBar/index.js
src/components/DataType.js
- Update devDependencies
- Reinstall libs:
del yarn.lock
rmdir /s node_modules
yarn
- Enable logging: uncomment
win.openDevTools()
inmain.js
- Run dev mode:
yarn dev
and test - Build
yarn ebuild
- Set graphQlUri to
https://arteigenschaften.ch/graphql
insrc/modules/graphQlUri
- Test if dynamic imports for exports work (apflora)
Uncaught Error: Cannot use e "__Schema" from another module or realm.
Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.
Is caused by graphql when several dependencies load different versions of graphql. Was solved in version 0.13, see:
yarn add graphql@0.13.2
as this version has solved the issue.- add to package.json:
...which is a yarn method to tackle this kind of problem :-)
"resolutions": { "graphql": "0.13.2" },