flutter/packages/flutter_tools/test/general.shard/web
David Iglesias 34b42acf1b
[web] Hides that Flutter uses requireJS in debug. (#129032)
Flutter web uses requireJS in `debug` mode to assemble a DDC-compiled app from a bunch of small files ("modules").

This caused that `canvaskit.js` (and all other modules that used a browserify-like loading header) didn't work because they attempted to use the `define` function provided by Flutter's instance of `requireJS` (which kept the defined modules private, rather than as globals on the page, as the users of the JS expected).

A [fix](https://github.com/flutter/engine/pull/27342) was added to `flutter/engine` to trick loaders into *not* using the `requireJS` module loader, but a recent change in the fix's js-interop layer *subtly* changed its JS output on the page (objects went from `undefined` to `null`), causing this:

* https://github.com/flutter/flutter/issues/126131 (and others)

This PR hides a bit of code that is commonly used by module loaders to decide that they may use the `define` function provided by requireJS (so the engine workaround can be removed).

## Next steps

* https://github.com/flutter/engine/pull/42941

## Issues

Partially addresses: https://github.com/flutter/flutter/issues/126131 (and others)

## Tests

* Added a unit test to ensure the `delete` stays
* Manually tested with the Gallery app in `debug` mode with a bunch of user-supplied scripts that currently fail to load.
  * Also tested hot restart as suggested by @nshahan
2023-06-23 02:09:12 +00:00
..
migrations Revert "[flutter_tools] Remove sound null safety flag (#123031)" (#123280) 2023-03-22 22:53:49 +00:00
bootstrap_test.dart [web] Hides that Flutter uses requireJS in debug. (#129032) 2023-06-23 02:09:12 +00:00
compile_web_test.dart tool/web: correctly log all options to web wasm compile (#126379) 2023-05-10 19:26:08 +00:00
devfs_web_test.dart flutter_tools: Flutter Web CLI cleanup (#124564) 2023-04-12 00:01:15 +00:00
devices_test.dart Revert "show web-server in flutter devices (#121373)" (#121532) 2023-02-27 18:44:09 +00:00
golden_comparator_process_test.dart Revert "Allow Flutter golden file tests to be flaky (#114450)" (#114902) 2022-11-08 09:26:55 -08:00
golden_comparator_test.dart Reland "Remove references to Observatory (#118577)" (#121606) 2023-02-28 11:57:04 -05:00
memory_fs_test.dart add missing trailing commas in list/set/map literals (#102585) 2022-04-27 09:15:35 +02:00
web_asset_server_test.dart Update packages + fix tests for javascript mime change (#118617) 2023-01-19 09:54:40 -05:00
web_expression_compiler_test.dart Null safety migration of packages/flutter_tools/test/general.shard, part 2/2 (#110712) 2022-09-07 12:28:52 -07:00
web_validator_test.dart [tools]Build IPA validation UI Polish (#116744) 2022-12-15 14:43:32 -08:00
workflow_test.dart Enable avoid_redundant_argument_values lint (#91409) (#91462) 2021-10-08 09:25:14 -07:00