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

Skip to content

Conversation

@justinfagnani
Copy link
Collaborator

@justinfagnani justinfagnani commented Jul 8, 2023

Fixes #2367
Supersedes #2836

This adds an initialValue config option. If set, the task is put into the COMPLETE status and initialValue is assigned to the current value of the task. Initial args are read off synchronously so that the task won't auto-run until the args change.

This is useful for when an element has the initial data available synchronously (maybe from hydration?) and wants to make the task look like it has completed a first run.

@changeset-bot
Copy link

changeset-bot bot commented Jul 8, 2023

🦋 Changeset detected

Latest commit: 8487dfb

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/task Minor

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 Jul 8, 2023

📊 Tachometer Benchmark Results

Summary

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

nop-update

  • lit-html-kitchen-sink: unsure 🔍 -16% - +12% (-3.90ms - +2.94ms)
    this-change vs tip-of-tree

render

  • lit-element-list: 62.66ms - 65.69ms
  • lit-html-kitchen-sink: unsure 🔍 -19% - +6% (-6.66ms - +2.01ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -7% - +3% (-0.66ms - +0.27ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -3% - +3% (-1.23ms - +1.51ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -3% - +2% (-1.17ms - +0.67ms)
    this-change vs tip-of-tree

update

  • lit-element-list: 752.21ms - 773.84ms
  • lit-html-kitchen-sink: unsure 🔍 -9% - +6% (-7.72ms - +5.51ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -8% - +1% (-21.51ms - +3.50ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -3% - +3% (-3.15ms - +3.01ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -2% - +1% (-12.29ms - +5.08ms)
    this-change vs tip-of-tree

update-reflect

  • lit-element-list: 703.77ms - 725.49ms
  • reactive-element-list: unsure 🔍 -1% - +1% (-9.42ms - +6.71ms)
    this-change vs tip-of-tree

Results

⏳ Benchmarks are currently running. Results below are out of date.
lit-element-list

render

VersionAvg timevs
62.66ms - 65.69ms-

update

VersionAvg timevs
752.21ms - 773.84ms-

update-reflect

VersionAvg timevs
703.77ms - 725.49ms-
lit-html-kitchen-sink

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
28.53ms - 34.91ms-unsure 🔍
-19% - +6%
-6.66ms - +2.01ms
unsure 🔍
-16% - +10%
-5.19ms - +3.36ms
tip-of-tree
tip-of-tree
31.12ms - 36.98msunsure 🔍
-7% - +22%
-2.01ms - +6.66ms
-unsure 🔍
-8% - +17%
-2.68ms - +5.50ms
previous-release
previous-release
29.79ms - 35.49msunsure 🔍
-11% - +17%
-3.36ms - +5.19ms
unsure 🔍
-16% - +8%
-5.50ms - +2.68ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
79.03ms - 88.94ms-unsure 🔍
-9% - +6%
-7.72ms - +5.51ms
unsure 🔍
-14% - +5%
-12.40ms - +4.74ms
tip-of-tree
tip-of-tree
80.71ms - 89.47msunsure 🔍
-7% - +9%
-5.51ms - +7.72ms
-unsure 🔍
-12% - +6%
-10.98ms - +5.53ms
previous-release
previous-release
80.82ms - 94.81msunsure 🔍
-6% - +15%
-4.74ms - +12.40ms
unsure 🔍
-7% - +13%
-5.53ms - +10.98ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
21.26ms - 26.50ms-unsure 🔍
-16% - +12%
-3.90ms - +2.94ms
unsure 🔍
-16% - +14%
-3.77ms - +3.35ms
tip-of-tree
tip-of-tree
22.16ms - 26.55msunsure 🔍
-12% - +16%
-2.94ms - +3.90ms
-unsure 🔍
-13% - +15%
-2.99ms - +3.53ms
previous-release
previous-release
21.68ms - 26.50msunsure 🔍
-14% - +16%
-3.35ms - +3.77ms
unsure 🔍
-14% - +12%
-3.53ms - +2.99ms
-
lit-html-repeat

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
8.93ms - 9.56ms-unsure 🔍
-7% - +3%
-0.66ms - +0.27ms
unsure 🔍
-9% - +1%
-0.83ms - +0.08ms
tip-of-tree
tip-of-tree
9.10ms - 9.78msunsure 🔍
-3% - +7%
-0.27ms - +0.66ms
-unsure 🔍
-7% - +3%
-0.65ms - +0.29ms
previous-release
previous-release
9.29ms - 9.95msunsure 🔍
-1% - +9%
-0.08ms - +0.83ms
unsure 🔍
-3% - +7%
-0.29ms - +0.65ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
260.38ms - 276.52ms-unsure 🔍
-8% - +1%
-21.51ms - +3.50ms
unsure 🔍
-4% - +3%
-12.14ms - +8.73ms
tip-of-tree
tip-of-tree
267.90ms - 287.01msunsure 🔍
-1% - +8%
-3.50ms - +21.51ms
-unsure 🔍
-2% - +7%
-4.32ms - +18.92ms
previous-release
previous-release
263.54ms - 276.77msunsure 🔍
-3% - +5%
-8.73ms - +12.14ms
unsure 🔍
-7% - +1%
-18.92ms - +4.32ms
-
lit-html-template-heavy

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
47.81ms - 49.81ms-unsure 🔍
-3% - +3%
-1.23ms - +1.51ms
unsure 🔍
-4% - +3%
-1.73ms - +1.48ms
tip-of-tree
tip-of-tree
47.73ms - 49.61msunsure 🔍
-3% - +3%
-1.51ms - +1.23ms
-unsure 🔍
-4% - +3%
-1.84ms - +1.30ms
previous-release
previous-release
47.68ms - 50.20msunsure 🔍
-3% - +4%
-1.48ms - +1.73ms
unsure 🔍
-3% - +4%
-1.30ms - +1.84ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
109.11ms - 113.75ms-unsure 🔍
-3% - +3%
-3.15ms - +3.01ms
unsure 🔍
-2% - +4%
-2.47ms - +4.04ms
tip-of-tree
tip-of-tree
109.49ms - 113.52msunsure 🔍
-3% - +3%
-3.01ms - +3.15ms
-unsure 🔍
-2% - +4%
-2.19ms - +3.90ms
previous-release
previous-release
108.37ms - 112.93msunsure 🔍
-4% - +2%
-4.04ms - +2.47ms
unsure 🔍
-3% - +2%
-3.90ms - +2.19ms
-
reactive-element-list

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
40.86ms - 42.10ms-unsure 🔍
-3% - +2%
-1.17ms - +0.67ms
unsure 🔍
-0% - +4%
-0.17ms - +1.52ms
tip-of-tree
tip-of-tree
41.05ms - 42.40msunsure 🔍
-2% - +3%
-0.67ms - +1.17ms
-slower ❌
0% - 4%
0.04ms - 1.81ms
previous-release
previous-release
40.23ms - 41.37msunsure 🔍
-4% - +0%
-1.52ms - +0.17ms
faster ✔
0% - 4%
0.04ms - 1.81ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
746.98ms - 759.03ms-unsure 🔍
-2% - +1%
-12.29ms - +5.08ms
unsure 🔍
-1% - +1%
-10.91ms - +6.17ms
tip-of-tree
tip-of-tree
750.35ms - 762.87msunsure 🔍
-1% - +2%
-5.08ms - +12.29ms
-unsure 🔍
-1% - +1%
-7.47ms - +9.94ms
previous-release
previous-release
749.32ms - 761.42msunsure 🔍
-1% - +1%
-6.17ms - +10.91ms
unsure 🔍
-1% - +1%
-9.94ms - +7.47ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
728.68ms - 739.39ms-unsure 🔍
-1% - +1%
-9.42ms - +6.71ms
unsure 🔍
-0% - +2%
-3.21ms - +11.41ms
tip-of-tree
tip-of-tree
729.36ms - 741.42msunsure 🔍
-1% - +1%
-6.71ms - +9.42ms
-unsure 🔍
-0% - +2%
-2.37ms - +13.27ms
previous-release
previous-release
724.96ms - 734.92msunsure 🔍
-2% - +0%
-11.41ms - +3.21ms
unsure 🔍
-2% - +0%
-13.27ms - +2.37ms
-

tachometer-reporter-action v2 for Benchmarks

@justinfagnani justinfagnani changed the title Allow tasks to have an initial value [labs/task] Allow tasks to have an initial value Jul 8, 2023
@justinfagnani justinfagnani merged commit 2ce10e4 into main Jul 8, 2023
@justinfagnani justinfagnani deleted the task-initial-value branch July 8, 2023 02:19
@lit-robot lit-robot mentioned this pull request Aug 2, 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/task] Allow setting initial data

2 participants