ProjectMirador / research-and-demos

Proofs of concept for Mirador 3
10 stars 8 forks source link

splits core and app into separate packages, adds complete configuration for dev and production #69

Closed christopher-johnson closed 5 years ago

christopher-johnson commented 5 years ago

This structure provides a basis for extensible "package oriented" component design and testing with a development server and environment and also a production deployment of mirador app. There are many, many options with webpack, so this should not be considered complete, but does provide reasonable defaults for further enhancement.

The separation of versioned libraries and feature/plugin components from the main app allows maintainability as the code-base grows. Currently, there is one library, mirador3-core which provides redux actions and reducers.

As a library then, mirador3-core is just a npm package and can be published by itself. Currently, since it is not published, it is referenced in the package.json with "file://"

The option in minimal_redux_poc to provide a distribution binary of mirador3-app for an non-optimized production app build is also be provided and can be created by running npm run dist. Note that production deployment with webpack primarily involves chunking, and this cannot be achieved with a distribution binary. Chunking optimizations are particularly advantageous for mobile platforms.

The procedure from a fresh clone of the repo is install, build dep packages (i.e. core, etc.), and run. See the .travis.yml file for the process. Until core is published, installing locally referenced packages must be done from each package root. If all deps packages are published then lerna bootstrapcan be used from root to install. After install, then lerna run build can be run from root which builds everything and then lerna run start to start the app.

This is a resubmission that moves src files from mirador_redux_poc to retain history. That directory is now empty of source except for two IT tests.

See https://github.com/ProjectMirador/research-and-demos/pull/67 for previous submission review comments.

An integration testing package that uses Cypress has also been created in packages/mirador3-e2e-tests. This currently depends on the distribution binary, but offers an extensible configuration to support multiple app builds from imports using a published artifact with webpack.

mejackreed commented 5 years ago

Thanks for modifying and resubmitting. I think it will be good to discuss this in person and perhaps in a larger group. Are you coming the working meeting in Edinburgh?

christopher-johnson commented 5 years ago

yes. I will be there. Look forward to discussing this then.

mejackreed commented 5 years ago

Excellent!

christopher-johnson commented 5 years ago

I close this per discussion in #66