{"action":"created","issue":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/3304","repository_url":"https://api.github.com/repos/WordPress/gutenberg","labels_url":"https://api.github.com/repos/WordPress/gutenberg/issues/3304/labels{/name}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/issues/3304/comments","events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/3304/events","html_url":"https://github.com/WordPress/gutenberg/issues/3304","id":270526618,"number":3304,"title":"Are iframes a viable long-term solution for meta boxes?","user":{"login":"kevinwhoffman","id":1938671,"avatar_url":"https://avatars3.githubusercontent.com/u/1938671?v=4","gravatar_id":"","url":"https://api.github.com/users/kevinwhoffman","html_url":"https://github.com/kevinwhoffman","followers_url":"https://api.github.com/users/kevinwhoffman/followers","following_url":"https://api.github.com/users/kevinwhoffman/following{/other_user}","gists_url":"https://api.github.com/users/kevinwhoffman/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinwhoffman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinwhoffman/subscriptions","organizations_url":"https://api.github.com/users/kevinwhoffman/orgs","repos_url":"https://api.github.com/users/kevinwhoffman/repos","events_url":"https://api.github.com/users/kevinwhoffman/events{/privacy}","received_events_url":"https://api.github.com/users/kevinwhoffman/received_events","type":"User","site_admin":false},"labels":[{"id":738764878,"url":"https://api.github.com/repos/WordPress/gutenberg/labels/[Component]%20Meta%20Boxes","name":"[Component] Meta Boxes","color":"fbca04","default":false},{"id":531680828,"url":"https://api.github.com/repos/WordPress/gutenberg/labels/[Type]%20Question","name":"[Type] Question","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":26,"created_at":"2017-11-02T04:08:37Z","updated_at":"2017-11-03T09:21:11Z","closed_at":null,"author_association":"NONE","body":"## Issue Overview\r\n\r\nGenerally speaking, iframes have been discouraged in web development for many years for reasons that are well-documented:\r\n\r\n- Handling of links\r\n- Difficulties in debugging JS within an iframe\r\n- Inability to style iframe content from the parent page\r\n- Inability to launch popovers/modals that extend beyond the dimensions of the iframe\r\n- Inflexibility regarding responsive design\r\n- Difficulties in resizing iframes with dynamic content\r\n\r\nWe began to explore the pros/cons of iframing the content area in https://github.com/WordPress/gutenberg/issues/2420, however iframed meta boxes were introduced in Gutenberg 1.5 without a similar discussion.\r\n\r\nSome of the issues that resulted are clearly related to iframes (https://github.com/WordPress/gutenberg/issues/3242 and https://github.com/WordPress/gutenberg/issues/3243) while others listed below may or may not be. Before making the effort to resolve these bugs one by one, we should consider whether iframes are a viable long-term solution for meta boxes and what kind of effects that decision would have on users and developers.\r\n\r\n## The Big Question\r\n\r\n**Can these issues be addressed _without requiring modification_ of the theme or plugin that generates the meta box?**\r\n\r\nWe have to consider that third-party code that has powered meta boxes for years may not have the luxury of being updated in order to be compatible within an iframe.\r\n\r\n## Additional Questions\r\n\r\n1. Given existing issues with saving data from meta boxes (https://github.com/WordPress/gutenberg/issues/3277), are we confident that editing content in iframes will not result in any data loss? In other words, is the inability to save data in some meta boxes a temporary bug or a technical limitation of mixing iframes with React?\r\n2. What kind of challenges are introduced when it comes to debugging PHP or JS meta box functionality when they are placed within iframes?\r\n3. Many plugins enqueue CSS and JS that affect multiple meta boxes - some in the main column and some in the sidebar. Gutenberg currently uses two separate iframes for the main column and sidebar. If we support meta boxes that appear after the Title, that would theoretically result in a third iframe. Will this present any issues regarding how plugins enqueue assets that must affect all iframed meta boxes?\r\n4. What, if any, accessibility challenges are introduced by placing meta boxes in an iframe?\r\n5. What, if any, issues are related to iframes on mobile?\r\n6. Is it possible to launch a content window from a meta box that extends beyond the iframe?\r\n\r\n## Screenshot\r\n\r\nIn the screenshot below (Gutenberg 1.6), iframes are marked with a red border to show their location. In this case, Yoast and WooCommerce meta boxes exist within the iframe. WooCommerce requires use of both the main column and sidebar iframes.\r\n\r\n![gutenberg-meta-box-iframes](https://user-images.githubusercontent.com/1938671/32313330-c1d19484-bf78-11e7-8185-5f9c44089c00.png)\r\n\r\n## Related Issues and/or PRs\r\n\r\n- https://github.com/WordPress/gutenberg/issues/2420\r\n- https://github.com/WordPress/gutenberg/issues/3242\r\n- https://github.com/WordPress/gutenberg/issues/3243\r\n- https://github.com/WordPress/gutenberg/issues/3165\r\n- https://github.com/WordPress/gutenberg/issues/3277\r\n- https://github.com/WordPress/gutenberg/issues/3182\r\n"},"comment":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/comments/341653334","html_url":"https://github.com/WordPress/gutenberg/issues/3304#issuecomment-341653334","issue_url":"https://api.github.com/repos/WordPress/gutenberg/issues/3304","id":341653334,"user":{"login":"gonzomir","id":827958,"avatar_url":"https://avatars1.githubusercontent.com/u/827958?v=4","gravatar_id":"","url":"https://api.github.com/users/gonzomir","html_url":"https://github.com/gonzomir","followers_url":"https://api.github.com/users/gonzomir/followers","following_url":"https://api.github.com/users/gonzomir/following{/other_user}","gists_url":"https://api.github.com/users/gonzomir/gists{/gist_id}","starred_url":"https://api.github.com/users/gonzomir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonzomir/subscriptions","organizations_url":"https://api.github.com/users/gonzomir/orgs","repos_url":"https://api.github.com/users/gonzomir/repos","events_url":"https://api.github.com/users/gonzomir/events{/privacy}","received_events_url":"https://api.github.com/users/gonzomir/received_events","type":"User","site_admin":false},"created_at":"2017-11-03T09:21:11Z","updated_at":"2017-11-03T09:21:11Z","author_association":"CONTRIBUTOR","body":"After reading the discussion and thinking about the projects I build with WordPress, and things I see people do with WordPress, I came to the conclusion that Gutenberg should be opt-in for custom post types. This will allow current websites that use CPT for a structured data to continue to work and new websites where WordPress is used as a CMS to be build. I want just to remind you that when registering a post type we can explicitly declare the support for editor field together with other features. Then why not just add explicit support for Gutenberg there? Of course this will not fix the issue with meta boxes added to posts and pages, but it will allow WordPress to be used as a CMS in the future."}}
{"actor":{"display_login":"gonzomir"}}