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

[Spike] Consolidate page elements into single iFrame #5944

Closed
turbochef opened this issue Jun 21, 2023 · 2 comments
Closed

[Spike] Consolidate page elements into single iFrame #5944

turbochef opened this issue Jun 21, 2023 · 2 comments

Comments

@turbochef
Copy link
Contributor

turbochef commented Jun 21, 2023

Page elements like the sidebar currently each have their own iframes. This means that adding new elements need their own html files that instantiate their own react apps, update the manifest.json to allow the browser to have access to the html file, and in order to access the redux store, devs have to instantiate a new one. I propose we consolidate all of these items into single iframe/react-app. This would significantly reduce the barrier adding page elements.

@fregante
Copy link
Contributor

fregante commented Nov 5, 2023

If I remember correctly the only reason why we are using iframes at all is because Bootstrap uses rem CSS units, which "conflict" with root font size of the page. Everything else would be sandboxed enough by ShadowRoots.

Apart from the sidebar, which probably makes extensive use of Bootstrap, I think everything else should be migrated away from bootstrap or somehow adjusted to not use rem (someone, somewhere surely already had this issue and published a fork)

At any rate, it's impractical to have a single iframe because some of our frames need to "take space" in the document, I think, like the panels. This is actually where ShadowRoot would be easier to handle as it wouldn't need the iframe resizer.

The only scenario where our iframed documents could be merged would be for the overlays.

@fregante fregante closed this as not planned Won't fix, can't repro, duplicate, stale Apr 7, 2024
@fregante
Copy link
Contributor

fregante commented Apr 7, 2024

Closing because:

it's impractical to have a single iframe

A POC for removing frames altogether lives in:

These two will make it easier to implement isolated widgets that work with or without frames:

For example:

  • ./SomeComponent.tsx: a regular React component
  • some-component.html: an HTML page that calls render(<SomeComponent/>, document.body)
  • contentScript.ts: calls renderWidget(<IsolatedComponent><SomeComponent/></IsolatedComponent>)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants