also looking at this
fix(mobile): preserve native editing, navigation, and durable media requests
#369
36 files
+864
-185
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -1449,7 +1449,8 @@ describe('native renderer component contract', () => { | ||
| 1449 | 1449 | it('restores UIKit TextInput accessibility values when authored metadata is removed', () => { |
| 1450 | 1450 | expect(ios).toContain('private var authoredAccessibilityValues = Set<ObjectIdentifier>()') |
| 1451 | 1451 | expect(ios).toContain('else if authoredAccessibilityValues.remove(id) != nil') |
| 1452 | expect(iosNativeUnitTests).toContain('XCTAssertNil(field.accessibilityValue)') | |
| 1452 | expect(iosNativeUnitTests).toContain('XCTAssertNotEqual(field.accessibilityValue, "Custom value")') | |
| 1453 | expect(iosNativeUnitTests).toContain('XCTAssertEqual(field.accessibilityValue, native.accessibilityValue)') | |
| 1453 | 1454 | expect(guide).toContain('removing that prop') |
| 1454 | 1455 | }) |
| 1455 | 1456 | |
| @@ -1606,13 +1607,13 @@ describe('native renderer component contract', () => { | ||
| 1606 | 1607 | for (const marker of [ |
| 1607 | 1608 | 'imageTasks.values.forEach { $0.cancel() }', |
| 1608 | 1609 | 'pendingCapabilityDeadlines.values.forEach { $0.cancel() }', |
| 1609 | 'pendingTimers.values.forEach { $0.cancel() }', | |
| 1610 | 'CraftNativeScriptThread.run { timers.pending.values.forEach { $0.cancel() } }', | |
| 1610 | 1611 | 'pendingCapabilityRequests.forEach { CraftNativeActions.cancel(requestToken: $0) }', |
| 1611 | 1612 | 'lifecycleObservers.forEach(NotificationCenter.default.removeObserver)', |
| 1612 | 'jsContext.objectForKeyedSubscript("__stxNativeUnmount")?.call(withArguments: [])', | |
| 1613 | 'CraftNativeScriptThread.run { context.objectForKeyedSubscript("__stxNativeUnmount")?.call(withArguments: []) }', | |
| 1613 | 1614 | 'let inStack = navigationController?.viewControllers.contains(where: { $0 === self }) ?? false', |
| 1614 | 1615 | 'if !inStack {', |
| 1615 | 'disposeRuntime()\n navigation.setViewControllers', | |
| 1616 | 'self.disposeRuntime()\n navigation.setViewControllers', | |
| 1616 | 1617 | ]) expect(ios, `${marker} missing from iOS teardown`).toContain(marker) |
| 1617 | 1618 | |
| 1618 | 1619 | for (const marker of [ |
| @@ -3012,10 +3013,11 @@ describe('native renderer component contract', () => { | ||
| 3012 | 3013 | }) |
| 3013 | 3014 | |
| 3014 | 3015 | it('releases replaced iOS row roots when a keyed identity changes type', () => { |
| 3015 | expect(ios).toContain('if let previous, previous.view !== next.view {') | |
| 3016 | expect(ios).toContain('if let previous, previous.view !== next.view, !adopting {') | |
| 3016 | 3017 | expect(ios).toContain('self.forgetHandlers(previous)') |
| 3017 | expect(ios).toContain('for child in rootStack.arrangedSubviews where child !== next.view') | |
| 3018 | expect(ios).toContain('if next.view.superview !== rootStack { rootStack.addArrangedSubview(next.view) }') | |
| 3018 | expect(iosFlatList).toContain('guard hostedView !== view else { return }') | |
| 3019 | expect(iosFlatList).toContain('hostedView?.removeFromSuperview()\n hostedView = view') | |
| 3020 | expect(iosFlatList).toContain('contentView.addSubview(view)') | |
| 3019 | 3021 | }) |
| 3020 | 3022 | |
| 3021 | 3023 | it('waits for asynchronous Android native fixture updates before asserting', () => { |