editorial: [aria.js] generate roleInfo after respec runs#2769
Conversation
Rewrites buildRoleInfo.js to make it independent of aria.js
by using the "compiled" specification (after respec runs).
Note: adds several hacks to keep bugs alive (to simplify review).
- .github/worflows/roleInfo.yml
- run on gh-pages pushes (to get latest respec result)
- checkout main
- checkout index.html from gh-pages (to get latest respec result)
- simplify buildRoleInfo.js call
- add reset of index.html
- common/script/ariaPreprocessing.js
- duplicate prohibited and deprecated status for global properties
on list items to preserve it after resolveReferences removes
*ref elements.
- common/script/buildRoleInfo.js
- complete rewrite to run independently from aria.js
- collects states&props
- loops through role sections and processes the characteristics tables
- NOTE: several hacks to recreate bugs (to simplify review)
- common/script/roleInfo.js
- regenerate for review
- all changes are either
- removal of duplicates
- change of position
Part of #2501
✅ Deploy Preview for wai-aria ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
🚀 Deployed on https://deploy-preview-2769--wai-aria.netlify.app |
| push: | ||
| branches: | ||
| - main | ||
| - gh-pages |
There was a problem hiding this comment.
I don't know how to test this without merging. Also, this may help with or may be blocked by #2768.
There was a problem hiding this comment.
Only way would be through setting up a fork
There was a problem hiding this comment.
I thought this is the cleanest way: when a version is published to github, we update roleinfo.
| required: false, | ||
| disallowed: false, | ||
| deprecated: false, | ||
| }, |
There was a problem hiding this comment.
This diff is worse than my local diff was. Reviewers may want to try to paste this version into their local editor for diffing.
There are a few simple de-duplications as well as a few larger groups (gridcell changes are the most "confusing" part).
Remove output hack after rewrite.
|
Hoping to take a look at this next week! |
| node-version: "latest" | ||
| - run: npm i linkedom prettier@3.6.0 | ||
| - run: node ./common/script/buildRoleInfo.js > ./common/script/roleInfo.js | ||
| - run: node ./common/script/buildRoleInfo.js |
There was a problem hiding this comment.
I am not clear how this check would work. In PRs you don't have the respec esported spec, previews are built at run time.
There was a problem hiding this comment.
Oh! You're right. My brain clearly stopped working at some point.
I'll fix it.
There was a problem hiding this comment.
@daniel-montalvo I've updated this to run respec before buildRoleInfo (and resetting index.html before diffing roleInfo.js)
| push: | ||
| branches: | ||
| - main | ||
| - gh-pages |
There was a problem hiding this comment.
Only way would be through setting up a fork
spectranaut
left a comment
There was a problem hiding this comment.
Ok, I just read through this all and ran it locally, these changes overall seem fine! Lolcry at the hacks though. Are you thinking of removing "currentlyBroken" as a next step?
I remain confused about the extra logic for marking things are deprecated thought, see comments.
| link => { | ||
| const name = link.textContent.split(' ')[0]; //TODO: hack because roletype has (state) inside link (as the only role to have that), cf. TODO: in ariaPreprocessing.js | ||
| const prop = structuredClone(statesAndProps[name]); | ||
| if (key !== 'roletype') prop.deprecated = false; // TODO: should roletype have deprecated=true when the spec lists everything as supported? |
There was a problem hiding this comment.
Can you explain this comment/situation to me... probably a silly question but I'm having trouble wrapping around why is deprecated always set to false, when there are entries in roleInfo.js where deprecated is true?
There was a problem hiding this comment.
If an attribute shows up in a characteristics table, then it's not deprecated on this role.
(For role=roletype, roleInfo lists the 4 attributes "deprecated as global in 1.2" as deprecated: true - hence the TODO).
There was a problem hiding this comment.
Oh, I should add: I'm not saying this is correct (looking again now, I think it's not but I haven't had enough coffee yet).
I'm just trying to reproduce roleInfo.js as much as possible right now, with code that's hopefully easier to reason about. (And if we have identified a bug here, then I'll take that as a win 🥳 )
- improve notes on running respec - remove dead code (identified by review)
Yes. I hope to discuss it on today's editors call. |
- add respec to npm install - run respec before buildRoleInfo.js - checkout index.html before git diff
|
Discussed in the last editors' call https://www.w3.org/2026/05/13-aria-editors-minutes.html#e0aa |
- buildRoleInfo.js - remove hack to reproduce bug in old implementation. - roleInfo.js: manual update
|
@spectranaut as discussed I've removed the "main" hack and regenerated roleInfo.js. |
🚀 Netlify Preview:
🔄 this PR updates the following sspecs: