Skip to content

Move template-no-class-bindings to RFC Appendix B - #2843

Closed
NullVoxPopuli wants to merge 1 commit into
nvp/v14-preview-recommended-configfrom
nvp/class-bindings-is-hbs-only
Closed

Move template-no-class-bindings to RFC Appendix B#2843
NullVoxPopuli wants to merge 1 commit into
nvp/v14-preview-recommended-configfrom
nvp/class-bindings-is-hbs-only

Conversation

@NullVoxPopuli

Copy link
Copy Markdown
Contributor

Stacked on #2840. template-no-class-bindings should not be in the gjs/gts recommended set.

The rule opts out of strict mode in its own create:

const isStrictMode = context.filename.endsWith('.gjs') || context.filename.endsWith('.gts');
if (isStrictMode) {
  return {};
}

Its tests assert the same, with the reasoning: "@classBinding in GJS/GTS may be a legitimate component argument". Linting a .gjs file with only this rule on reports nothing. Enabling it for gjs/gts is lint time with no coverage, which is the Appendix B criterion.

So this moves it from Appendix A to Appendix B: drops recommendedGjs/recommendedGts, regenerates the rule lists, docs, and the snapshot. The gjs/gts set goes from 88 to 87 rules.

The RFC's Appendix A also lists this rule and its Appendix B count says 9. Both need the same move, which the RFC's unresolved-questions section allows without re-RFCing. Say the word and I will push that to the RFC branch.

Alternative, if the maintainer view is that @classNameBindings passed to a classic component from a gjs template should be reported: drop the strict-mode guard from the rule instead and keep it in Appendix A. That is a behavior change, so it is not this PR.

🤖 Generated with Claude Code

The rule returns {} for gjs/gts, so enabling it there was lint cost with
no coverage. Drops it from the gjs/gts recommended set.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🏎️ Benchmark Comparison

Benchmark Control (p50) Experiment (p50) Δ
🟢 js small 15.62 ms 14.70 ms -5.9%
🟢 js medium 7.61 ms 7.16 ms -5.9%
🟢 js large 3.01 ms 2.69 ms -10.7%
gjs small 1.29 ms 1.27 ms -1.4%
gjs medium 637.77 µs 627.49 µs -1.6%
gjs large 254.51 µs 253.17 µs -0.5%
gts small 1.27 ms 1.25 ms -1.3%
gts medium 635.07 µs 629.01 µs -1.0%
gts large 252.11 µs 248.44 µs -1.5%

🟢 faster · 🔴 slower · 🟠 slightly slower · ⚪ within 2%

Full mitata output
clk: ~3.10 GHz
cpu: AMD EPYC 7763 64-Core Processor
runtime: node 24.19.0 (x64-linux)

benchmark                   avg (min … max) p75 / p99    (min … top 1%)
------------------------------------------- -------------------------------
js small (control)            18.21 ms/iter  18.68 ms ▅ █                  
                      (13.23 ms … 33.43 ms)  29.42 ms █ █▆                 
                    (  5.78 mb …  10.35 mb)   7.32 mb ████▄█▄█▁▄▁▁▄▄▄▁▄▁█▁▄

js small (experiment)         15.48 ms/iter  16.11 ms █▅ █                 
                      (13.38 ms … 23.09 ms)  23.07 ms ██▆█▆ █              
                    (  6.02 mb …   8.90 mb)   6.44 mb █████▁██▁▄▁▁▁▄▁▁▁▄▁▁▄

                             ┌                                            ┐
                             ╷   ┌─────────┬┐                             ╷
          js small (control) ├───┤         │├─────────────────────────────┤
                             ╵   └─────────┴┘                             ╵
                             ╷ ┌───┬─┐                  ╷
       js small (experiment) ├─┤   │ ├──────────────────┤
                             ╵ └───┴─┘                  ╵
                             └                                            ┘
                             13.23 ms           21.32 ms           29.42 ms

summary
  js small (experiment)
   1.18x faster than js small (control)

------------------------------------------- -------------------------------
js medium (control)            8.43 ms/iter   8.65 ms  █                   
                       (7.19 ms … 15.62 ms)  15.36 ms ▆█                   
                    (  3.45 mb …   4.12 mb)   3.58 mb ██▅▃▄▃▃▂▂▂▁▃▁▁▂▁▂▁▁▁▂

js medium (experiment)         7.66 ms/iter   8.05 ms  █                   
                       (6.57 ms … 13.95 ms)  13.66 ms ▃█▇                  
                    (  2.57 mb …   3.96 mb)   3.31 mb ███▅▅▄▅▂▂▃▃▁▃▁▁▁▁▁▁▁▂

                             ┌                                            ┐
                                ╷┌─────┬┐                                 ╷
         js medium (control)    ├┤     │├─────────────────────────────────┤
                                ╵└─────┴┘                                 ╵
                             ╷┌────┬─┐                           ╷
      js medium (experiment) ├┤    │ ├───────────────────────────┤
                             ╵└────┴─┘                           ╵
                             └                                            ┘
                             6.57 ms           10.96 ms            15.36 ms

summary
  js medium (experiment)
   1.1x faster than js medium (control)

------------------------------------------- -------------------------------
js large (control)             3.36 ms/iter   3.18 ms  █                   
                        (2.84 ms … 8.66 ms)   6.62 ms  █                   
                    ( 89.59 kb …   2.80 mb)   1.45 mb ██▃▃▃▂▂▂▂▁▁▁▁▁▁▁▁▂▁▁▁

js large (experiment)          3.10 ms/iter   2.96 ms  █                   
                        (2.47 ms … 8.44 ms)   6.92 ms  █                   
                    (260.00 kb …   2.44 mb)   1.34 mb ▅█▆▃▂▂▁▂▂▂▂▁▂▁▁▂▁▁▁▁▁

                             ┌                                            ┐
                                 ╷┌───┬                                ╷
          js large (control)     ├┤   │────────────────────────────────┤
                                 ╵└───┴                                ╵
                             ╷ ┌───┬                                      ╷
       js large (experiment) ├─┤   │──────────────────────────────────────┤
                             ╵ └───┴                                      ╵
                             └                                            ┘
                             2.47 ms            4.70 ms             6.92 ms

summary
  js large (experiment)
   1.09x faster than js large (control)

------------------------------------------- -------------------------------
gjs small (control)            1.43 ms/iter   1.38 ms █                    
                        (1.22 ms … 7.29 ms)   6.04 ms █▂                   
                    (634.19 kb …   1.57 mb)   1.06 mb ██▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

gjs small (experiment)         1.42 ms/iter   1.31 ms █                    
                        (1.22 ms … 6.95 ms)   5.93 ms █                    
                    (164.52 kb …   1.78 mb)   1.06 mb █▅▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

                             ┌                                            ┐
                             ┌─┬                                          ╷
         gjs small (control) │ │──────────────────────────────────────────┤
                             └─┴                                          ╵
                             ┌─┬                                         ╷
      gjs small (experiment) │ │─────────────────────────────────────────┤
                             └─┴                                         ╵
                             └                                            ┘
                             1.22 ms            3.63 ms             6.04 ms

summary
  gjs small (experiment)
   1.01x faster than gjs small (control)

------------------------------------------- -------------------------------
gjs medium (control)         700.87 µs/iter 654.39 µs █                    
                      (601.03 µs … 6.30 ms)   3.33 ms █                    
                    ( 32.02 kb …   1.09 mb) 541.33 kb █▄▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

gjs medium (experiment)      679.90 µs/iter 648.83 µs █▄                   
                      (594.91 µs … 5.90 ms)   1.94 ms ██                   
                    (300.75 kb …   1.11 mb) 540.67 kb ██▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

                             ┌                                            ┐
                             ╷┌┬                                          ╷
        gjs medium (control) ├┤│──────────────────────────────────────────┤
                             ╵└┴                                          ╵
                             ┌┬                    ╷
     gjs medium (experiment) ││────────────────────┤
                             └┴                    ╵
                             └                                            ┘
                             594.91 µs           1.96 ms            3.33 ms

summary
  gjs medium (experiment)
   1.03x faster than gjs medium (control)

------------------------------------------- -------------------------------
gjs large (control)          282.04 µs/iter 269.16 µs  █▃                  
                      (239.62 µs … 5.84 ms) 374.23 µs  ██▂                 
                    (216.10 kb … 808.91 kb) 217.30 kb ████▇█▇▄▂▂▂▁▁▁▁▁▁▁▁▁▁

gjs large (experiment)       281.86 µs/iter 266.25 µs  █▄                  
                      (237.84 µs … 6.23 ms) 380.01 µs  ██▃▂                
                    (169.98 kb … 953.11 kb) 216.78 kb █████▆▇▃▂▂▁▁▁▁▁▁▁▁▁▁▁

                             ┌                                            ┐
                              ╷ ┌──────────┬                            ╷
         gjs large (control)  ├─┤          │────────────────────────────┤
                              ╵ └──────────┴                            ╵
                             ╷ ┌───────────┬                              ╷
      gjs large (experiment) ├─┤           │──────────────────────────────┤
                             ╵ └───────────┴                              ╵
                             └                                            ┘
                             237.84 µs         308.92 µs          380.01 µs

summary
  gjs large (experiment)
   1x faster than gjs large (control)

------------------------------------------- -------------------------------
gts small (control)            1.38 ms/iter   1.29 ms █                    
                        (1.22 ms … 6.90 ms)   5.97 ms █                    
                    (506.57 kb …   1.64 mb)   1.06 mb █▃▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

gts small (experiment)         1.34 ms/iter   1.28 ms █                    
                        (1.21 ms … 6.49 ms)   4.49 ms █                    
                    (350.09 kb …   1.77 mb)   1.05 mb █▄▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

                             ┌                                            ┐
                             ┌─┬                                          ╷
         gts small (control) │ │──────────────────────────────────────────┤
                             └─┴                                          ╵
                             ┌┬                             ╷
      gts small (experiment) ││─────────────────────────────┤
                             └┴                             ╵
                             └                                            ┘
                             1.21 ms            3.59 ms             5.97 ms

summary
  gts small (experiment)
   1.03x faster than gts small (control)

------------------------------------------- -------------------------------
gts medium (control)         682.48 µs/iter 652.74 µs  █                   
                      (601.79 µs … 6.08 ms)   1.18 ms ▃█▅                  
                    ( 34.92 kb …   1.11 mb) 541.34 kb ███▄▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

gts medium (experiment)      679.81 µs/iter 645.69 µs  █                   
                      (595.62 µs … 5.89 ms)   1.45 ms  █                   
                    ( 94.18 kb …   1.07 mb) 540.15 kb ██▄▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

                             ┌                                            ┐
                             ╷ ┌──┬                         ╷
        gts medium (control) ├─┤  │─────────────────────────┤
                             ╵ └──┴                         ╵
                             ╷┌──┬                                        ╷
     gts medium (experiment) ├┤  │────────────────────────────────────────┤
                             ╵└──┴                                        ╵
                             └                                            ┘
                             595.62 µs           1.02 ms            1.45 ms

summary
  gts medium (experiment)
   1x faster than gts medium (control)

------------------------------------------- -------------------------------
gts large (control)          276.40 µs/iter 267.06 µs  █                   
                      (239.61 µs … 5.78 ms) 356.88 µs  ██▂                 
                    (216.09 kb … 809.03 kb) 217.05 kb ▅███▅█▆▅▃▂▂▁▁▁▁▁▁▁▁▁▁

gts large (experiment)       272.82 µs/iter 263.97 µs  █                   
                      (236.61 µs … 5.44 ms) 359.73 µs  █▇                  
                    (215.70 kb … 952.93 kb) 216.66 kb ▆███▅▇▆▄▂▂▁▁▁▁▁▁▁▁▁▁▁

                             ┌                                            ┐
                              ╷ ┌───────────┬                            ╷
         gts large (control)  ├─┤           │────────────────────────────┤
                              ╵ └───────────┴                            ╵
                             ╷ ┌──────────┬                               ╷
      gts large (experiment) ├─┤          │───────────────────────────────┤
                             ╵ └──────────┴                               ╵
                             └                                            ┘
                             236.61 µs         298.17 µs          359.73 µs

summary
  gts large (experiment)
   1.01x faster than gts large (control)

@NullVoxPopuli

Copy link
Copy Markdown
Contributor Author

Closing: @ember/component is still supported, so @classBinding / @classNameBindings passed from a gjs/gts template still hits the classic path and is worth reporting. Appendix A is right; the rule's strict-mode guard is the bug. Replacement PR incoming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant