next.js
caa595eb - Turbopack: handle removed routes (#77890)

Commit
1 year ago
Turbopack: handle removed routes (#77890) ### Why? Before `get_endpoints` gives you a lot of `Vc<Endpoint>`, which we keep around and subscribe to. That is a problem as endpoint can also vanish at any time. e. g. when the folder is removed. `Vc<Endpoint>` was not able to represent this state. The subscription throw an error as the Vc is no longer existant. So the error was technically correct here (not a bug in turbo-tasks). But in practice we don't want to have this error. We want to have a clean end of the subscription without any error. That's why I change it to `Vc<Option<Endpoint>>`, which allows to represent the non-existance of an endpoint. This can (resp. need to be) handled in subscriptions, which can report e. g. a `NotFound` result or a change event (for server_changed). ### What? avoid having inactive Vcs when routes are removed. instead use an `Option<Endpoint>` to allow respresenting removed endpoints and handle these in subscriptions correctly.
Author
Parents
Loading