Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bennypowers
Copy link
Collaborator

@bennypowers bennypowers commented Aug 24, 2023

fixes #4136

  • constructor-assigned, non-decorated fields (i have my doubts about how well i implement this)
  • non-decorated readonly typescript class fields
  • non-decorated javascript class fields with @readonly jsdoc
  • non-decorated getter-only accessors (i.e. readonly: true)
  • non-decorated accessor pairs

@changeset-bot
Copy link

changeset-bot bot commented Aug 24, 2023

🦋 Changeset detected

Latest commit: b3f0929

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lit-labs/analyzer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Aug 24, 2023

📊 Tachometer Benchmark Results

Summary

⏳ Benchmarks are currently running. Results below are out of date.

nop-update

  • this-change, tip-of-tree, previous-release: unsure 🔍 -3% - +11% (-0.75ms - +2.57ms)
    this-change vs tip-of-tree

render

  • this-change: 80.24ms - 83.63ms
  • this-change, tip-of-tree, previous-release: unsure 🔍 -7% - +3% (-2.47ms - +0.85ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -2% - +2% (-0.90ms - +1.27ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -3% - +1% (-1.73ms - +0.50ms)
    this-change vs tip-of-tree

update

  • this-change: 867.93ms - 886.14ms
  • this-change, tip-of-tree, previous-release: unsure 🔍 -2% - +7% (-1.24ms - +6.00ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -2% - +2% (-2.44ms - +1.96ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -2% - +1% (-14.55ms - +8.07ms)
    this-change vs tip-of-tree

update-reflect

  • this-change: 829.06ms - 845.10ms
  • this-change, tip-of-tree, previous-release: unsure 🔍 -1% - +1% (-12.44ms - +9.85ms)
    this-change vs tip-of-tree

Results

⏳ Benchmarks are currently running. Results below are out of date.
this-change

render

VersionAvg timevs
80.24ms - 83.63ms-

update

VersionAvg timevs
867.93ms - 886.14ms-

update-reflect

VersionAvg timevs
829.06ms - 845.10ms-
this-change, tip-of-tree, previous-release

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
30.83ms - 33.36ms-unsure 🔍
-7% - +3%
-2.47ms - +0.85ms
unsure 🔍
-7% - +3%
-2.30ms - +0.95ms
tip-of-tree
tip-of-tree
31.83ms - 33.98msunsure 🔍
-3% - +8%
-0.85ms - +2.47ms
-unsure 🔍
-4% - +5%
-1.34ms - +1.62ms
previous-release
previous-release
31.75ms - 33.79msunsure 🔍
-3% - +7%
-0.95ms - +2.30ms
unsure 🔍
-5% - +4%
-1.62ms - +1.34ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
85.48ms - 90.68ms-unsure 🔍
-2% - +7%
-1.24ms - +6.00ms
unsure 🔍
-4% - +4%
-3.11ms - +3.50ms
tip-of-tree
tip-of-tree
83.17ms - 88.21msunsure 🔍
-7% - +1%
-6.00ms - +1.24ms
-unsure 🔍
-6% - +1%
-5.43ms - +1.06ms
previous-release
previous-release
85.84ms - 89.92msunsure 🔍
-4% - +4%
-3.50ms - +3.11ms
unsure 🔍
-1% - +6%
-1.06ms - +5.43ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
23.28ms - 25.91ms-unsure 🔍
-3% - +11%
-0.75ms - +2.57ms
unsure 🔍
-5% - +11%
-1.19ms - +2.49ms
tip-of-tree
tip-of-tree
22.68ms - 24.70msunsure 🔍
-10% - +3%
-2.57ms - +0.75ms
-unsure 🔍
-8% - +6%
-1.89ms - +1.38ms
previous-release
previous-release
22.66ms - 25.23msunsure 🔍
-10% - +5%
-2.49ms - +1.19ms
unsure 🔍
-6% - +8%
-1.38ms - +1.89ms
-
this-change, tip-of-tree, previous-release

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
57.56ms - 59.22ms-unsure 🔍
-2% - +2%
-0.90ms - +1.27ms
unsure 🔍
-1% - +3%
-0.80ms - +1.62ms
tip-of-tree
tip-of-tree
57.51ms - 58.90msunsure 🔍
-2% - +2%
-1.27ms - +0.90ms
-unsure 🔍
-2% - +2%
-0.89ms - +1.35ms
previous-release
previous-release
57.10ms - 58.86msunsure 🔍
-3% - +1%
-1.62ms - +0.80ms
unsure 🔍
-2% - +2%
-1.35ms - +0.89ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
121.04ms - 124.35ms-unsure 🔍
-2% - +2%
-2.44ms - +1.96ms
unsure 🔍
-3% - +2%
-3.25ms - +1.95ms
tip-of-tree
tip-of-tree
121.49ms - 124.38msunsure 🔍
-2% - +2%
-1.96ms - +2.44ms
-unsure 🔍
-2% - +2%
-2.88ms - +2.06ms
previous-release
previous-release
121.34ms - 125.34msunsure 🔍
-2% - +3%
-1.95ms - +3.25ms
unsure 🔍
-2% - +2%
-2.06ms - +2.88ms
-
this-change, tip-of-tree, previous-release

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
48.25ms - 49.83ms-unsure 🔍
-3% - +1%
-1.73ms - +0.50ms
faster ✔
1% - 5%
0.54ms - 2.74ms
tip-of-tree
tip-of-tree
48.86ms - 50.44msunsure 🔍
-1% - +4%
-0.50ms - +1.73ms
-unsure 🔍
-4% - +0%
-2.12ms - +0.07ms
previous-release
previous-release
49.92ms - 51.44msslower ❌
1% - 6%
0.54ms - 2.74ms
unsure 🔍
-0% - +4%
-0.07ms - +2.12ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
871.97ms - 889.01ms-unsure 🔍
-2% - +1%
-14.55ms - +8.07ms
unsure 🔍
-2% - +1%
-16.85ms - +6.53ms
tip-of-tree
tip-of-tree
876.30ms - 891.17msunsure 🔍
-1% - +2%
-8.07ms - +14.55ms
-unsure 🔍
-1% - +1%
-12.84ms - +9.01ms
previous-release
previous-release
877.65ms - 893.65msunsure 🔍
-1% - +2%
-6.53ms - +16.85ms
unsure 🔍
-1% - +1%
-9.01ms - +12.84ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
857.86ms - 873.29ms-unsure 🔍
-1% - +1%
-12.44ms - +9.85ms
unsure 🔍
-2% - +1%
-15.65ms - +6.50ms
tip-of-tree
tip-of-tree
858.83ms - 874.91msunsure 🔍
-1% - +1%
-9.85ms - +12.44ms
-unsure 🔍
-2% - +1%
-14.58ms - +8.03ms
previous-release
previous-release
862.20ms - 878.10msunsure 🔍
-1% - +2%
-6.50ms - +15.65ms
unsure 🔍
-1% - +2%
-8.03ms - +14.58ms
-

tachometer-reporter-action v2 for Benchmarks

@bennypowers
Copy link
Collaborator Author

At the moment, the accessors aren't even added to the fieldsMap

@bennypowers bennypowers marked this pull request as ready for review August 24, 2023 08:56
Copy link
Collaborator

@justinfagnani justinfagnani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!


constructor() {
super();
this.constructorAssignOnly = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make something readonly that's in the LitElement static properties block?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd still want to cover the case of a javascript file with a constructor-assigned field

imo readonly is an additional layer to that

Copy link
Collaborator

@justinfagnani justinfagnani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@justinfagnani justinfagnani merged commit 5ff19a0 into lit:main Aug 24, 2023
@bennypowers bennypowers deleted the fix/analyzer/readonly-propertylike branch August 24, 2023 17:05
@lit-robot lit-robot mentioned this pull request Aug 30, 2023
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.

[labs/analyzer]: readonly fields

2 participants