Skip to content

Commit

Permalink
refactor(index): async flow control (fastify#405)
Browse files Browse the repository at this point in the history
* refactor(index): async flow control

* refactor(index): factor up all html minification

* refactor(index): remove readCallbackEnd

* refactor(index): factor up all undefined `page` checks

* refactor(index): review nits

- viewDecorator: remove spurious defined check
- decorateReply: capitalize getHeader check
- minify definition: null instead of false when not enabled
- getRequestedPath: remove spurious optional chaining
- use optional chaining for layout checks
- avoid “assign to `x` then return `x`” pattern

* test(ejs): add test for invalid template

Closes fastify#404

Add a regression test for previously incorrect behavior: when the `fastify` instance had an `onError` added, errors thrown by renderer resulted in server crash.

* refactor(index): avoid reading the same file concurrently

---------

Co-authored-by: uzlopak <[email protected]>
  • Loading branch information
mweberxyz and Uzlopak authored Feb 19, 2024
1 parent a8cf590 commit 235f588
Show file tree
Hide file tree
Showing 2 changed files with 237 additions and 437 deletions.
Loading

0 comments on commit 235f588

Please sign in to comment.