oddbird / oddbird/css-anchor-positioning
Improve file organization to reduce cycles
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 493
- Forks
- 18
- Avg merge
- 12h 37m
- Merged PRs (30d)
- 5
Description
Checking the real runtime graph, there are exactly two cycles:
1.
cascade → utils → dom → cascade(withutils ↔ domnested inside it)This is the one that actually bites. Probing module-body evaluation shows
SHIFTED_PROPERTIESis not yet initialized whendom.ts's body runs — it only gets away with it because the read happens insidegetCSSPropertyValuerather than at module scope. All three edges are single-use:
dom → cascadeexists solely forSHIFTED_PROPERTIES(dom.ts:51)
utils → domexists solely forstrategyForElement(utils.ts:292→getCSSPropertyValue)
dom → utilsexists solely forgetRootStyleContainer(dom.ts:105)2.
parse ↔ fallbackOnly
isIdentifieris a real value edge —AnchorPosition,AnchorPositionsandTryBlockare types and already erase.parseneedsparsePositionFallbacks;fallbackneeds those four.Perhaps look at improving this in a new PR?
Originally posted by @jpzwarte in #448
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the runtime imports and module bodies in dom.ts, utils.ts, cascade, parse, and fallback, focusing on the edges and symbols identified in the issue. Confirm the two cycles and their evaluation behavior, then reorganize the modules so the cycles are removed without changing the affected behavior. Done means the listed runtime cycles no longer exist and module initialization remains safe.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100