Skip to content

Commit

Permalink
Merge branch 'master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
i-like-robots committed Feb 3, 2020
2 parents 523b7cf + 8d95f04 commit b296b36
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/design-decisions/app-context.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Design Decisions: App context

App context is a combination of metadata about the current application and the page it is serving for use by client-side code. This is a change from the existing FT.com toolset.

Previously metadata was embedded into the HTML as data attributes on the document element (`<html>`). This implementation had several problems:

- What the metadata properties were and how they should be used was not defined anywhere.
- The mechanism was often misused to pass additional information from server to client which lead to de facto standards emerging across different parts of FT.com.
- We did not know who or what relies on this data meaning we were scared to change it, or fix it.
- Several properties had changed in scope, either the name became irrelevant or the type of data had changed.

To help resolve this our implementation of app context is based upon a schema which documents and guarantees the data. The schema also defines how the feature can be used to reduce the chances of it being re-purposed or misused. The schema also enables us provide an official reference for people to follow because we don't always know who or what may be using the data.

Finally, the app context feature has enabled us to refactor the [ads] and [tracking] components. They now provide their own, separate options, and are deterministic rather than each arbitrarily scraping pages for information.

[ads]: https://github.com/Financial-Times/n-ads/
[tracking]: https://github.com/Financial-Times/n-tracking/

## Decision owners

- Matt Hinchliffe
- Ifeanyi Isitor

0 comments on commit b296b36

Please sign in to comment.