Closed
Description
Today, the dart2js gives a warning when invoked in an unsupported context, like outside the dart cli and internal build systems. Since #46100 developers are expected to invoke dart2js via "dart compile js".
The only way to invoke dart2js outside the standard way is to directly access its snapshot (which is not in an advertised location of the SDK). Only internal build systems and the flutter tool do this today.
We would like to make it an error to invoke the snapshot directly, except for those counted supported cases.
To do so, we need to:
- [tool][web] Pass invoker flag to dart2js. flutter/flutter#122344 - Fix the invocation from the flutter tool to use the
--invoker
flag (which marks flutter tools as an allowed entrypoint) or to usedart compile js
instead. - Change dart2js to issue an error going forward when the
--invoker
flag is missing.