Skip to content

Conversation

JakobJingleheimer
Copy link
Member

Forked from #32

JakobJingleheimer added a commit to JakobJingleheimer/loaders that referenced this pull request Oct 10, 2021
changes to recursive design forked to nodejs#41
Copy link
Member

@GeoffreyBooth GeoffreyBooth left a comment

Choose a reason for hiding this comment

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

Thanks for doing this. I know this is “my” proposal so if you want me to take it from here just let me know and I’ll try to find the time, otherwise I’m happy for you to keep improving it.

});
}
```
</details>
Copy link
Member

Choose a reason for hiding this comment

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

We should probably have an example of shortCircuit: true in either the resolve or load chains. Like maybe for load it could be ordered so that https always runs, and then either CoffeeScript or Babel: CoffeeScript if we have CoffeeScript to process, and then short-circuit; or Babel otherwise, and then short-circuit.

Copy link
Member Author

Choose a reason for hiding this comment

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

Mm, agreed. I thiiink the mock-loader example I was planning to (subsequently?) add would have a shortCircuit in resolve.

@JakobJingleheimer
Copy link
Member Author

@GeoffreyBooth whichever 🙂 If I do keep it, I also don't mind if you make updates (rather than wait for me to do it).

@GeoffreyBooth GeoffreyBooth added the loaders-agenda Issues and PRs to discuss during the meetings of the Loaders team label Oct 20, 2021
@GeoffreyBooth
Copy link
Member

@JakobJingleheimer I did a quick pass to resolve my notes other than the “we should add a short circuit example” one.

@JakobJingleheimer JakobJingleheimer force-pushed the update-recursive-design-doc branch from 705b3de to 52aba4f Compare October 26, 2021 19:46
@JakobJingleheimer JakobJingleheimer force-pushed the update-recursive-design-doc branch from 52aba4f to 068f343 Compare October 26, 2021 20:07
@GeoffreyBooth
Copy link
Member

I think the name for this pattern is the “middleware” pattern: https://muniftanjim.dev/blog/basic-middleware-pattern-in-javascript/

Perhaps we should call it that rather than recursive? There’s not actually any recursion going on, it’s one function calling another that calls another.

@GeoffreyBooth GeoffreyBooth merged commit 9df83a2 into nodejs:main Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

loaders-agenda Issues and PRs to discuss during the meetings of the Loaders team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants