fix(sdk): make forceEmbedLayout default to true for embed methods #1817
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.
A couple more updates for the upcoming 1.7.0 release.
Breaking-ish change
When using one of the
StackBlitzSDK.embedProject*methods to generate a<iframe>embedding a StackBlitz project, and when the user doesn't provide aforceEmbedLayoutvalue inEmbedOptions, then we setforceEmbedLayouttotrueinstead ofundefined.This results in generated URLs having the
embed=1query string parameter and using the embed layout, instead of using the generic editor layout (with a top bar, login button, forking on saving as an anonymous user, etc.).According to @EricSimons, the current behavior is a bug dating back 4+ years ago. So a fix would be welcome to make it more likely that embeds actually use the embed layout.
It's still a change in behavior, and while many users might see it as a feature upgrade, others might be relying on embedding the StackBlitz editor with the normal (non-embed) layout, which is kinda unsupported and can behave strangely but who knows, there might be a few people out there that make it work.
For those users of the SDK, their options would be remaining on
@stackblitz/[email protected]or lower, or providing{ forceEmbedLayout: false }in options.Example usage:
A couple extra fixes for the road