trunk icon indicating copy to clipboard operation
trunk copied to clipboard

Remove `data-` prefix from our various Trunk attributes

Open thedodd opened this issue 2 years ago • 7 comments

Originally when I first starting building Trunk, I thought that I was going to care a lot more about having a semantic index.html, and I perceived that others would as well.

As Trunk has grown in usage and features, having to prefix attributes of our various asset types with data- is pretty much just an inconvenience, and doesn't matter AT ALL, given that the attributes are all removed from the final output index.html.

This is something that we could do before we hit a v1.0, depending on what the community thinks about this. Please let me know! Cheers

thedodd avatar Jul 28 '21 16:07 thedodd

I think it's important to allow users to specify the tags they want. I.e. we should avoid namespace collisions, like someone who wants a something attribute in their HTML would not be kept from doing so if Trunk had a data-something attribute. But if we removed the data- prefix, the something attribute would get processed by Trunk rather than being kept in the output.

Maybe renaming data- to trunk- or even -trunk- (like a CSS-vendor-prefix) would be an idea worth considering?

Tanja-4732 avatar Jul 30 '21 00:07 Tanja-4732

While the possibility of data- conflicts is low, I think that's a good enough reason to move to a trunk-specific attribute to process assets.

trunk- works brilliantly, IMO.

lanesawyer avatar Jul 30 '21 06:07 lanesawyer

I also favor trunk- over data-.

simbleau avatar Jul 23 '22 14:07 simbleau

I too believe we should move from data to trunk.

Should we use

  1. trunk- or
  2. -trunk-

to disambiguate further? It's kind of like css vendor prefixes.

Does anyone have ideas on this issue? I'd love to hear your thoughts on this one.

Tanja-4732 avatar Jul 23 '22 15:07 Tanja-4732

I'd prefer 1.

simbleau avatar Jul 23 '22 16:07 simbleau

I'd vote 1.

I support making this move, but we will just need to ensure it is backwards compatible. We update our teaching docs on the site, examples &c; however, we continue to support the old pattern until we hit 1.0 or so.

We could issue deprecation warnings from the CLI when we detect old usage and such.

thedodd avatar Jul 25 '22 17:07 thedodd

Concurrence from me.

simbleau avatar Jul 25 '22 17:07 simbleau

trunk- ☑️

hammadmajid avatar Feb 14 '23 19:02 hammadmajid

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Nov 14 '23 00:11 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Nov 19 '23 00:11 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

???

Tanja-4732 avatar Dec 04 '23 17:12 Tanja-4732