Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(engine): isBeingConstructed flag is not get out of sync #284

Merged
merged 1 commit into from
May 7, 2018

Conversation

caridy
Copy link
Contributor

@caridy caridy commented May 7, 2018

Details

the flag to track the construction process was not restored correctly when the constructor throws and there is no boundary to recovery from such failure. this PR fixes that so it can never be out of sync, using the same trick that we use for isRendering.

Does this PR introduce a breaking change?

  • No

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 8bf1dd5 | Target commit: 7efa3cf

lwc-engine-benchmark

table-append-1k metric base(8bf1dd5) target(7efa3cf) trend
benchmark-table/append/1k duration 151.90 (± 4.90 ms) 149.10 (± 5.30 ms) 1.84% 👌
table-clear-1k metric base(8bf1dd5) target(7efa3cf) trend
benchmark-table/clear/1k duration 12.15 (± 0.65 ms) 11.90 (± 0.50 ms) 2.06% 👌
table-create-10k metric base(8bf1dd5) target(7efa3cf) trend
benchmark-table/create/10k duration 867.50 (± 7.50 ms) 856.30 (± 4.80 ms) 1.29% 👍
table-create-1k metric base(8bf1dd5) target(7efa3cf) trend
benchmark-table/create/1k duration 103.10 (± 1.60 ms) 103.60 (± 2.10 ms) -0.48% 👌
table-update-10th-1k metric base(8bf1dd5) target(7efa3cf) trend
benchmark-table/update-10th/1k duration 93.80 (± 5.80 ms) 92.60 (± 4.90 ms) 1.28% 👌
tablecmp-append-1k metric base(8bf1dd5) target(7efa3cf) trend
benchmark-table-component/append/1k duration 253.30 (± 4.60 ms) 263.20 (± 5.30 ms) -3.91% 👎
tablecmp-clear-1k metric base(8bf1dd5) target(7efa3cf) trend
benchmark-table/clear/1k duration 32.20 (± 1.20 ms) 33.55 (± 1.80 ms) -4.19% 👎
tablecmp-create-10k metric base(8bf1dd5) target(7efa3cf) trend
benchmark-table-component/create/10k duration 1721.50 (± 10.00 ms) 1704.50 (± 7.40 ms) 0.99% 👍
tablecmp-create-1k metric base(8bf1dd5) target(7efa3cf) trend
benchmark-table-component/create/1k duration 199.10 (± 4.80 ms) 197.00 (± 3.30 ms) 1.05% 👍
tablecmp-update-10th-1k metric base(8bf1dd5) target(7efa3cf) trend
benchmark-table-component/update-10th/1k duration 74.00 (± 3.20 ms) 76.00 (± 4.20 ms) -2.70% 👌

@caridy
Copy link
Contributor Author

caridy commented May 7, 2018

@apapko if you want to add a test for this. The scenario is:

  • add a error boundary on the parent
  • throw in the child's constructor
  • in the errorCallback, try to set an attribute on the parent's host (it will throw saying that you're still constructing something.

Copy link
Contributor

@davidturissini davidturissini left a comment

Choose a reason for hiding this comment

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

Nice change. Consistent with other approaches

Copy link
Collaborator

@apapko apapko left a comment

Choose a reason for hiding this comment

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

Looks good, but missing tests

@caridy caridy merged commit 888bd0d into master May 7, 2018
@caridy caridy deleted the caridy/is-being-constructor-fix branch May 7, 2018 22:39
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.

3 participants