Client-side routing for recent EMS versions #229
Draft
+2,163
−2,025
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Status
Proposed for discussion
Context
Since 7.6 EMS and ems-landing-page releases have matched the Elastic Stack minor releases. Currently, each release of ems-landing-page (v7.6, v7.7, v7.8...) is created in a new branch and each branch is published as separate applications in subdirectories in a Google Bucket.
The region maps visualization and Elastic Maps application in Kibana includes links to the matching release of EMS landing-page. For example, Kibana v7.4 links to https://maps.elastic.co/v7.4, Kibana v7.6 to https://maps.elastic.co/v7.6, and so on).
Because each version of ems-landing-page is a live website, we do our best to maintain security updates for all versions. Currently, this requires us to backport fixes to all previous branches and fix merge conflicts when necessary which is time consuming.
To eliminate this tech debt, I am proposing switching to a client side routing technique using React Router. Because of limited changes to the schema of the EMS manifests, the current ems-client library supports versions of EMS >= v6.6.
Decision
TBD
Consequences
This PR is a moderate refactor that uses react-router to load the corresponding EMS manifest version based on the URL path. This allows us to maintain a single codebase without requiring backports that can cause merge conflicts.
There were significant changes between EMS v2 and EMS v6.6 manifests which will require more work to implement. Breaking changes in future EMS manifest versions may become harder to implement. We might consider maintaining separate branches for major EMS versions that have breaking changes (v2, v6.x, v7.x, v8.x).
@thomasneirynck @nyurik @jsanz