UKHomeOfficeForms / hof-roadmap

A repository to track issues related to the hof development roadmap
MIT License
1 stars 0 forks source link

HOF Component Design #10

Open JoeChapman opened 7 years ago

JoeChapman commented 7 years ago

HOF Component Design requirements and considerations:

What do we hope to solve with components?

What would the interface for a component look like?

TBC - but would almost necessarily be exposed in the form of middleware.

How could a component integrate with HOF?

As express middleware. A hof implementation (or hof itself as appropriate) should be able to app.use(component) and have that work fairly seamlessly.

What elements of an app could a component replace?

Where do we start?

sulthan-ahmed commented 7 years ago

Good questions, could I also ask, what components do we need? Address-lookup?

JoeChapman commented 7 years ago

The HOF Component concept is driven by a desire to remove cross module dependencies where the use of one module might require the need for another. You could refer to it as peer dependencies.

JoeChapman commented 7 years ago

One approach we might take to lessen the burden on the developer when implementing a HOF app is to ship co-dependent resources together. Such as in the case that a field - called 'foo' for example purposes - requires a specific translation, controller or style. That might be as a module, e.g. hof-component-foo. Or in the case where foo is necessary to HOF core, it is baked into hof

lennym commented 7 years ago

Address lookup is probably a bit big for what we're describing here. It might incorporate components, but probably wouldn't be a component.

Initial targets for components would be:

Broadly speaking, they would be modules that can be embedded into a page, but that contain all their own functionality/templates/translations in a single module, without needing other implicit cross-dependencies.

JoeChapman commented 7 years ago

Componentising collections of elements such as Address lookup would be ace (IMO), but as Lenny has just pointed out, "probably a bit big for what we're describing here".

lennym commented 7 years ago

I heard React is cool.

sulthan-ahmed commented 7 years ago

me too, heard it's componentised.

Are we thinking of making HOF work in/with React? What are the reasons?