Fwd: Change to debug mode for Semantics

34 views
Skip to first unread message

Dan Field

unread,
Jun 13, 2019, 5:17:47 PM6/13/19
to flutt...@googlegroups.com


---------- Forwarded message ---------
From: Dan Field <dnf...@google.com>
Date: Thu, Jun 13, 2019 at 1:42 PM
Subject: Change to debug mode for Semantics
To: <flutter-...@googlegroups.com>


Today, Flutter only builds the semantic tree if an a11y service is enabled*. This results in a performance gain, since the semantics tree is non-trivial to build and process, and we want to avoid spending that time if there are no consumers.

This has a serious downside: many developers build and test apps without ever enabling an a11y service, and thus miss semantics bugs (whether in the framework, a package, or their own code) that they could have learned from via asserts.

I'm proposing forcing the Semantics tree construction and upload to be enabled in debug mode to help developers catch these issues earlier.  This may result in performance degradation in debug mode, and may result in asserts being thrown for a11y reasons even though those services are disabled. The upside is that it will help catch such issues before your app goes to production and an a11y user finds the app crashing.

PR: https://github.com/flutter/engine/pull/9312 (for debug mode - tests is TBD)

* iOS Simulators are the exception, where a11y is always enabled.

Dan Field

unread,
Jun 26, 2019, 4:53:18 AM6/26/19
to flutt...@googlegroups.com, flutter-...@googlegroups.com
After some discussion, I'm going to try a different approach for enabling this or disabling it for debug mode - I'd still like to see it enabled by default, but have it be toggleable from the tooling and/or IDE.

I have made some progress on the other part of the issue, which is also a breaking change: enabling semantics by default in widget tests.  PR is here: https://github.com/flutter/flutter/pull/35110

It will be possible to avoid this by explicitly setting `semanticsEnabled: false` in your `testWidgets` method call.
Reply all
Reply to author
Forward
0 new messages