Skip to content

Commit

Permalink
Merge pull request #28 from fiddleheadjs/bugfix_miss_flush_currently_…
Browse files Browse the repository at this point in the history
…processing_info_on_error

Bugfix miss flush currently processing info on error
  • Loading branch information
quyettvq authored Feb 1, 2023
2 parents 51408dd + e98d633 commit 9f1b34e
Show file tree
Hide file tree
Showing 24 changed files with 160 additions and 29 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.7.7 (Feb 01, 2023)

- Bugfix: Miss flushing currently processing info on error, that leads to lost of tracking of the current hook

## 1.7.6 (Jan 31, 2023)

- Bugfix: Effect dependencies undefined when re-run the callback without re-rendering
Expand Down
7 changes: 5 additions & 2 deletions lib/core/cjs.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -1478,11 +1478,14 @@ let _reconcileOnlyChildOfDynamicNode = (current, alternate, isRenderRoot) => {
prepareCurrentlyProcessing(current);
try {
newContent = current.type_(current.props_);
flushCurrentlyProcessing();
} catch (error) {
catchError(error, current);
newContent = null;
// Must flush currently processing info before catchError(),
// because catchError() may cause re-render at a higher level component
flushCurrentlyProcessing();
catchError(error, current);
}
flushCurrentlyProcessing();

let newChild = createVNodeFromContent(newContent);

Expand Down
7 changes: 5 additions & 2 deletions lib/core/cjs.development.legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1456,12 +1456,15 @@ var _reconcileOnlyChildOfDynamicNode = function _reconcileOnlyChildOfDynamicNode

try {
newContent = current.type_(current.props_);
flushCurrentlyProcessing();
} catch (error) {
newContent = null; // Must flush currently processing info before catchError(),
// because catchError() may cause re-render at a higher level component

flushCurrentlyProcessing();
catchError(error, current);
newContent = null;
}

flushCurrentlyProcessing();
var newChild = createVNodeFromContent(newContent);

if (newChild !== null) {
Expand Down
2 changes: 1 addition & 1 deletion lib/core/cjs.development.legacy.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/core/cjs.development.min.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions lib/core/cjs.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -1478,11 +1478,14 @@ let _reconcileOnlyChildOfDynamicNode = (current, alternate, isRenderRoot) => {
prepareCurrentlyProcessing(current);
try {
newContent = current.type_(current.props_);
flushCurrentlyProcessing();
} catch (error) {
catchError(error, current);
newContent = null;
// Must flush currently processing info before catchError(),
// because catchError() may cause re-render at a higher level component
flushCurrentlyProcessing();
catchError(error, current);
}
flushCurrentlyProcessing();

let newChild = createVNodeFromContent(newContent);

Expand Down
7 changes: 5 additions & 2 deletions lib/core/cjs.production.legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1456,12 +1456,15 @@ var _reconcileOnlyChildOfDynamicNode = function _reconcileOnlyChildOfDynamicNode

try {
newContent = current.type_(current.props_);
flushCurrentlyProcessing();
} catch (error) {
newContent = null; // Must flush currently processing info before catchError(),
// because catchError() may cause re-render at a higher level component

flushCurrentlyProcessing();
catchError(error, current);
newContent = null;
}

flushCurrentlyProcessing();
var newChild = createVNodeFromContent(newContent);

if (newChild !== null) {
Expand Down
2 changes: 1 addition & 1 deletion lib/core/cjs.production.legacy.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/core/cjs.production.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions lib/core/esm.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -1474,11 +1474,14 @@ let _reconcileOnlyChildOfDynamicNode = (current, alternate, isRenderRoot) => {
prepareCurrentlyProcessing(current);
try {
newContent = current.type_(current.props_);
flushCurrentlyProcessing();
} catch (error) {
catchError(error, current);
newContent = null;
// Must flush currently processing info before catchError(),
// because catchError() may cause re-render at a higher level component
flushCurrentlyProcessing();
catchError(error, current);
}
flushCurrentlyProcessing();

let newChild = createVNodeFromContent(newContent);

Expand Down
7 changes: 5 additions & 2 deletions lib/core/esm.development.legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1451,12 +1451,15 @@ var _reconcileOnlyChildOfDynamicNode = function _reconcileOnlyChildOfDynamicNode

try {
newContent = current.type_(current.props_);
flushCurrentlyProcessing();
} catch (error) {
newContent = null; // Must flush currently processing info before catchError(),
// because catchError() may cause re-render at a higher level component

flushCurrentlyProcessing();
catchError(error, current);
newContent = null;
}

flushCurrentlyProcessing();
var newChild = createVNodeFromContent(newContent);

if (newChild !== null) {
Expand Down
Loading

0 comments on commit 9f1b34e

Please sign in to comment.