speced / speced/respec

State object instead of module states

Open
#2,835 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

refactoring
Dominant language
JavaScript
Stars
806
Forks
434
Avg merge
1d 21h
Merged PRs (30d)
32

Description

From #2832:

I really don't want more module level state variables 1) as they are major blockers against #2187 as those variables only initialize once and 2) it makes harder to track how modules depends on others. Modules should ideally only export functions and constants, not variables.

I guess 2) is hard to solve in current code structure though, but maybe we can create a new object to save states and pass it instead of current conf to at least make modules more modularized:

const respecDoc = {
  configuration, // current conf
  possibleExternalLinks,
  /* ... other states that can change during module runs ... */
};

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 by reviewing the concerns in #2832 and the blocker described in #2187, then trace where module-level state and the current conf object are used. The proposed direction is a shared state object such as respecDoc, but the issue does not identify files, entry points, or tests. Done would require a defined modular state design and corresponding updates across the affected modules.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
developer-experience, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.