4 ms·
i had to update an anchor tag yesterday in html from a#foo to a#bar: - the <a> was a react element (a dependency in 1 million diff places) - href value was a
by 5350-uiop-1130 4y ago
i had to update an anchor tag yesterday in html from a#foo to a#bar:
- the <a> was a react element (a dependency in 1 million diff places)
- href value was a prop coming from an API
- footnote (to which the anchor goes) was a handlebar template in different repo
- the ID of footnote required modifying a seperate JS util which handles numerical increments (also updating test, and PR comments)
- the <a>, href, and footnote are all joined and bundled together using variety of complex scripts
this is normally a 10 second task. but thanks to simple modern javascript it took me best part of a week and a lot of complexity fatigue & depressive thoughts.
- zztop44 4y agoTo be fair that sounds like an architecture issue and sounds like in reality the task was a lot more complex than a#foo -> a#bar. If the href needed to come from the api and the ID needed to be incremented and unknowable ahead of time then there were always going to be complexities. But it’s not like React stops you from hardcoding href URIs (said as someone who generally avoids using React whenever I can).
- 5350-uiop-1130 4y ago> in reality the task was a lot more complex than a#foo -> a#bar. it really wasn't. been doing this for 15 years. seen all the trends. cargo-culting mentality. a lot of new-ish folks really really don't know any better. first instinct is to hit npm i. the idea of static html is alien to many.