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

Version 5.0.0 #1212

Merged
merged 390 commits into from
May 17, 2024
Merged

Version 5.0.0 #1212

merged 390 commits into from
May 17, 2024

Conversation

davidjbradshaw
Copy link
Owner

@davidjbradshaw davidjbradshaw commented Feb 15, 2024

New documentation site

Upgrade

For the most part version 5 will be a drop in replacement. The following guide explains how the API has been simplified in the new version.

New features

  • Added automatic selection of best page size calculation method
  • Added check for html elements overflowing document body with console warning to advise on how to optimise the performance of page size calculation in this this situation
  • Added getParentProperties() function that returns the following information from the parent page:
    • iFrame boundingClientRect details
    • Position and size of scrollable page area
    • Inner size of the bowser window
  • Added offsetHeight & offsetWidth options to adjust values returned from iframe
  • Added direction option
  • Added postMessageTarget option to better support GAS iframes
  • Log element used to calculate lowest/rightmost/tagged element
  • Added visibility checks to disable resizing when either the page or the iframe is hidden
  • Added direct message passing for same domain iframes, this gives much improved performance over postMessage()
  • Added CSS animation to examples
  • Added width resizing to the examples
  • Added WordPress guide to docs

Changes

  • Changed default height calculation method to auto
  • Improved performance optimisation of element based page size calculation methods
  • Replaced user interaction and browser event detection with the newish ResizeObserver API, by adding it to all non-static page elements. This provides improved detection of CSS :hover, CSS Animation, <textarea/> user resizing events and remove the need for user interaction event listeners.
  • Deprecated heightCalculationMethod/widthCalculationMethod in favour of auto calculation mode detection
  • Deprecated data-iframe-height / date-iframe-width for data-iframe-size
  • Deprecated sizeHeight and sizeWidth in favour of new direction option
  • Deprecated getPageInfo() in favour of getParentProperties() which returns more reliable and useful data
  • Renamed onInit() -> onReady() , and added deprecation warning
  • Renamed size() -> resize() in iframe, and added deprecation warning
  • Split out jQuery support into it's own packages @iframe-resizer/jquery
  • Changed MutationObserver to now just look for added nodes in the document tree and ensure that new non-static elements are covered by ResizeObserver
  • Enhanced warning messages
  • Removed minHeight, maxHeight, minWidth and maxHeight options, as modern CSS can now deal with this for us.
  • Removed log messages from production build (reduces file sizes by 20%)
  • Removed deprecated v3 methods. Calls to v3 methods will now fail, rather than be a warning
  • Removed mouse, touch and resize event listeners, as not required alongside ResizeObserver
  • Removed jQuery from examples
  • Removed legacy browser support, base support is now ecmaScript2020
  • Removed interval fallback, as no longer support browsers that require it
  • Removed Firefox invisible iframe fix, as no longer required

Fixes

Chore

  • Migrate build to Rollup
  • Migrate integration test to Chrome Headless
  • Split into multiple packages
  • Refactored code to more modern JavaScript (ongoing)
  • Migrate unit tests to Jest (ongoing)
  • Create publish script
  • Updated dependancies

Future roadmap

  • Add types for child API
  • log when new element is used to calculate size
  • Add Parent option to create data-iframe-size attrs via CSS selector
  • When checkOrigin has more than one target, iterate over them with postMessage(), rather than use *
  • Migrate warning to tiny-warning in React version
  • Detect and ignore elements elements anchored to the page bottom/right of the page
  • Detect when an iframe is removed from the page and auto disconnect with warning message
  • Add scrollBy() method
  • Add object { top: left: behaviour: } to scrollTo / scrollToOffeset
  • Add getTopInfo() method
  • Migrate to using pubSub patten
  • Add EventListener() methods
  • Investigate scrolling with sticky headers
  • Add auto same-domain code injection (@iframe-resizer/injector))

Framework components / plugins roadmap

  • Vue 3 / Nuxt
  • Svelte
  • SolidJS
  • Angular

js/iframeResizer.js Fixed Show fixed Hide fixed
js/iframeResizer.js Fixed Show fixed Hide fixed
src/iframeResizer.contentWindow.js Fixed Show fixed Hide fixed
src/iframeResizer.contentWindow.js Fixed Show fixed Hide fixed
src/iframeResizer.contentWindow.js Fixed Show fixed Hide fixed
src/iframeResizer.contentWindow.js Fixed Show fixed Hide fixed
src/iframeResizer.contentWindow.js Fixed Show fixed Hide fixed
src/iframeResizer.contentWindow.js Fixed Show fixed Hide fixed
src/iframeResizer.contentWindow.js Fixed Show fixed Hide fixed
test-main.js Fixed Show fixed Hide fixed
src/iframeResizer.contentWindow.js Fixed Show fixed Hide fixed
src/iframeResizer.contentWindow.js Fixed Show fixed Hide fixed
src/iframeResizer.contentWindow.js Fixed Show fixed Hide fixed
src/iframeResizer.contentWindow.js Fixed Show fixed Hide fixed
src/iframeResizer.js Fixed Show fixed Hide fixed
src/iframeResizer.js Fixed Show fixed Hide fixed
src/iframeResizer.contentWindow.js Fixed Show fixed Hide fixed
src/iframeResizer.contentWindow.js Fixed Show fixed Hide fixed
src/iframeResizer.contentWindow.js Fixed Show fixed Hide fixed
src/iframeResizer.contentWindow.js Fixed Show fixed Hide fixed
src/iframeResizer.js Fixed Show fixed Hide fixed
src/iframeResizer.js Fixed Show fixed Hide fixed
js/iframeResizer.js Fixed Show fixed Hide fixed
src/iframeResizer.js Fixed Show fixed Hide fixed
packages/child/index.js Fixed Show fixed Hide fixed
packages/child/index.js Dismissed Show dismissed Hide dismissed
packages/child/index.js Dismissed Show dismissed Hide dismissed
@davidjbradshaw davidjbradshaw changed the title Version 5.0.0 Beta Version 5.0.0 May 17, 2024
@davidjbradshaw davidjbradshaw merged commit bb88a95 into master May 17, 2024
3 checks passed
@davidjbradshaw davidjbradshaw deleted the v5-dev branch May 17, 2024 16:38
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.

1 participant