seas-computing / seas-computing/mark-one

Export MessageContext Components

Open
#179 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Currently, src/Alerts/MessageContext.ts exports a number of the base components needed to assemble a working message reducer in a consuming application. However, the barrel file in src/Alerts/index.ts is only exporting default, so the MessageContext itself is the only component that can be directly import into another app from mark-one. This results in us needing to do the following:

import { GlobalMessage } from 'mark-one';
import { MessageReducerAction, messageReducer } from 'mark-one/lib/Alerts/MessageContext';

As an immediate fix, we can update the index.ts to export everything from MessageContext.

As a longer term approach, we may want to define some kind of MessageWrapper that would bundle together more of the functionality into a single component that we can import along with a useDispatchMessage hook.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/Alerts/index.ts and compare its exports with the components and types exposed by src/Alerts/MessageContext.ts. Update the barrel export so consumers can import the MessageContext components from mark-one rather than the internal path. Done means the named exports are available through the package entry point; the longer-term MessageWrapper and useDispatchMessage ideas are separate scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.