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

Fire callbacks when targets are added or removed #367

Closed
wants to merge 9 commits into from

Commits on Apr 8, 2021

  1. Fire callbacks when targets are added or removed

    Closes [hotwired#336][]
    
    ---
    
    Implements the `TargetObserver` to monitor when elements declaring
    `[data-${identifier}-target]` are added or removed from a `Context`
    _after_ being connected and _before_ being disconnected.
    
    In support of iterating through target tokens, export the
    `TokenListObserver` module's `parseTokenString` function.
    
    [hotwired#336]: hotwired#336
    seanpdoyle committed Apr 8, 2021
    Configuration menu
    Copy the full SHA
    11649d7 View commit details
    Browse the repository at this point in the history
  2. attempt to fix CI

    replace Array function with a for loop
    seanpdoyle committed Apr 8, 2021
    Configuration menu
    Copy the full SHA
    78c094b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    86720fc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c182b82 View commit details
    Browse the repository at this point in the history
  5. Incorporate code review feedback

    Introduce the concept of a `TargetObserverDelegate`, then make `Context`
    implement the interface.
    seanpdoyle committed Apr 8, 2021
    Configuration menu
    Copy the full SHA
    770b2fd View commit details
    Browse the repository at this point in the history
  6. Touch up documentation

    seanpdoyle committed Apr 8, 2021
    Configuration menu
    Copy the full SHA
    21f2ca2 View commit details
    Browse the repository at this point in the history
  7. Add Node.isConnected to polyfills

    The implementation was sourced from the [Mozilla Developer Network
    documentation][poyfill] for [Node.isConnected][]
    
    [poyfill]: https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected#polyfill
    [Node.isConnected]: https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected
    seanpdoyle committed Apr 8, 2021
    Configuration menu
    Copy the full SHA
    e6e1d12 View commit details
    Browse the repository at this point in the history
  8. Attempt to address CI failure

    ```
    IE 11.0 (Windows 8.1) ERROR
    133
      Expected identifier, string or number
    134
      at @stimulus/core/dist/tests/index.js:2281:1
    135
    
    136
      SyntaxError: Expected identifier, string or number
    137
         at ./packages/@stimulus/polyfills/index.js (@stimulus/core/dist/tests/index.js:2281:1)
    ```
    
    ```
    IE 11.0 (Windows 8.1)  target disconnected callback when element is removed FAILED
    125
    	Promise rejected during "target disconnected callback when element is removed": Object doesn't support property or method 'remove'
    126
    	TypeError: Object doesn't support property or method 'remove'
    127
    	   at Anonymous function (eval code:191:25)
    ```
    seanpdoyle committed Apr 8, 2021
    Configuration menu
    Copy the full SHA
    1b6e95e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ef175d5 View commit details
    Browse the repository at this point in the history