dart-sdk/pkg/frontend_server/bin
Anna Gringauze 7466c1f9da [frontend_server] Make module names debugger-friendly
Module names and import module names generated by the frontend server
are currently breaking debugger's assumptions on module names. This
change fixes it to make debugger works with various compiler
configurations, such as build_runner, frontend server with dwds tests,
and unblocks flutter tools to continue debugger and frontend server
integration.

JavaScriptBundle
  - Change module import names to module names instead of file paths,
    omit leading '/' as it cannot be in a module name in requireJS
  - Module name changes are hidden under "debugger-module-names" flag
    to prevent breaking flutter tools.

FrontendServer
  - Always call exit after listening to commands is finished,
    otherwise process running frontend server does not exit on 'quit'
    command.
  - Call computeCanonicalNames after initial compilation to support
    subsequent module importing in compileExpressioToJs calls
  - Add error handling to usage of kernelToJs compilers

ExpressionCompiler
  - Separate library variables from library fields for loading modules,
    as they can be different, for example
    ```main = require('web/main.dart').web__main```

Closes https://github.com/dart-lang/sdk/issues/40832

Change-Id: Ic103c22932c7181ee325f239193d32361d057ed0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138010
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2020-03-05 07:39:33 +00:00
..
frontend_server_starter.dart