gatsby-remark-embedded-codesandbox
gatsby-remark-embedded-codesandbox copied to clipboard
Feature: Support large sandbox content
If the content passed to the GET define API is too large, CodeSandbox will return an HTTP 414 error (URI Too Long).
fetching the POST define API with ?json=1 (the "Define without Render" option) and then using the resulting URL for the iframe would be a workable solution:
https://codesandbox.io/docs/importing#xhr-request
This would require running asynchronous code within the transformer function, which can be achieved by returning a promise:
https://github.com/swimlane/DocSPA/blob/9155c2e07fa3105f4e7858e62e9877cfc4105706/projects/swimlane/docspa-remark-preset/src/plugins/short-codes.ts#L106
More information about async remark plugins: https://github.com/gatsbyjs/gatsby/issues/16403
I may end up implementing a PR of this myself, if I need it quick enough.