Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds removal of abortControllers when running in an SSG mode #84

Closed
wants to merge 1 commit into from

Conversation

courcelan
Copy link
Contributor

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.

Copy link
Contributor

@marcinpece-apptension marcinpece-apptension left a comment

Choose a reason for hiding this comment

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

- adds removal of abortControllers when running in an SSG mode
- ignores timeout
- sets cache to `no-cache` to speed up and lessen amount of repeated requests
@courcelan courcelan force-pushed the make-abort-controller-optional branch from f359a46 to 0b696af Compare June 11, 2024 16:43
@courcelan
Copy link
Contributor Author

closing as we went a different route in #85

@courcelan courcelan closed this Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants