equinor / equinor/fusion-framework
context: simplify the lazily-constructed default client in ContextModuleConfigurator.createConfig
- Dominant language
- TypeScript
- Stars
- 10
- Forks
- 10
- Avg merge
- 19h 40m
- Merged PRs (30d)
- 150
Description
`ContextModuleConfigurator.createConfig`'s default client construction is marked as overly lazy:
```ts
// TODO - make less lazy
config.client ??= await (async (): Promise => {
const apiProvider = await this._getServiceProvider(init);
const contextClient = await apiProvider.createContextClient('json$');
...
})();
```
Revisit this default-client construction to make it less lazily-evaluated / easier to follow (e.g. extract into a named method instead of an inline async IIFE).
_Originally flagged as a `// TODO` comment while resolving fusion-lint warnings on `fix/sematic-lint`._
Contributor guide
Research direction
Start at ContextModuleConfigurator.createConfig and inspect the inline async default-client construction shown in the issue, along with nearby configuration code. Revisit that construction so its flow is easier to follow and confirm that the default client behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100