Skip to content

Latest commit

 

History

History
541 lines (510 loc) · 28.1 KB

CHANGELOG.md

File metadata and controls

541 lines (510 loc) · 28.1 KB
  • #181: Remove unnecessary zoning on event handlers that interferes with testing
    • Handlers triggered by real events will now always be called in the root zone.

      In most cases, handlers were already running in the root zone, so this should not affect behavior. See #179 for more details.

    • When testing, you previous had to bind event handlers or callbacks triggered by event handlers to zones when using expect or expectAsync.

      var renderedInstance = renderIntoDocument(
        Button({}, {
          'onButtonPress': Zone.current.bindUnaryCallback(expectAsync((e) {
            // ...
          }, reason: 'onButtonPress not called')),
          'onClick': Zone.current.bindUnaryCallback((e) {
            expect(e.defaultPrevented, isTrue);
          }),
        }),
      );
      
      // ...
      Simulate.click(buttonNode);

      Now, handlers will be called in the zone they're triggered from, which makes testing events easier and more predictable:

      var renderedInstance = renderIntoDocument(
        Button({}, {
          'onButtonPress': expectAsync((e) {
            // ...
          }, reason: 'onButtonPress not called'),
          'onClick': (e) {
            expect(e.defaultPrevented, isTrue);
          },
        }),
      );
      
      // ...
      Simulate.click(buttonNode);
  • #182: Deprecate emptyJsMap:
    • Use newObject() from dart:js_util instead
  • #162: Add jsifyAndAllowInterop, deprecate some obsolete JS utils:
    • Deprecate jsify, setProperty, and getProperty; use versions from dart:js_util instead
    • Deprecate EmptyObject; use newObject from dart:js_util instead
  • #170: Reformat with line length of 120 for better readability
  • #162: Important Deprecations

    These deprecations are being put in place to prepare consumers for the upcoming 5.0.0 release which will include support for React JS version 16.x

    • react_server.dart and Dart VM server-side rendering
      • Server-side rendering via react_dom_server.dart, though untested, is still in place
    • Legacy context APIs
    • isMounted
    • react_test_utils.SimulateNative
    • String Component.refs
    • Component.replaceStates
    • Component.bind
    • Component.transferComponentState
  • #155: Clean the lint trap.

  • #152: Format all files using dartfmt.
  • #153: New unconvertJsProps utility function.
  • Improvement: Dart 2 compatible!