adds removal of abortControllers when running in an SSG mode #84
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a config option to force isSSG (static site generation).
When engaged, this removes the creation and use of all
AbortControllers
as these have a limit to the amount to be created. In SSG, builder may be attempting to run thousands of requests and this can cause memory issues within the build environment. The build system can not react to an AbortController in the same fashion that an in-browser fetch request may be handled, so we would rely on the build/compiler to issue its own warnings and handle the error.As we do not have an AbortController, we can not issue a cancel fetch request; so we mock up an console.warn about using cancelRequest. There is no intrinsic timeout available as the build environment would need to set this as fetch generally requires the use of an abort controller to cancel the request.