Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable experimental frontend server #865

Open
1 of 6 tasks
jakemac53 opened this issue Jan 3, 2020 · 7 comments
Open
1 of 6 tasks

Enable experimental frontend server #865

jakemac53 opened this issue Jan 3, 2020 · 7 comments
Labels
package:dwds package:webdev type-enhancement A request for a change that isn't a bug

Comments

@jakemac53
Copy link
Contributor

jakemac53 commented Jan 3, 2020

This is a meta issue tracking the frontend server integration/experimentation work for webdev.

  • Enable initial serve/build behind a flag
  • Enable incremental rebuilds
  • Reconcile module naming conventions (absolute uri vs packages/ + package relative uris)
  • Add build_runner integration for codegen
  • Enable debugging with dwds
  • Ensure that imports to dart:io are disallowed statically like they are with build_runner.
@jakemac53 jakemac53 added the type-enhancement A request for a change that isn't a bug label Jan 3, 2020
@jakemac53
Copy link
Contributor Author

cc @grouma as I assume me and you will be working on this as time allows

@jakemac53
Copy link
Contributor Author

I have started working on this in this branch https://github.com/dart-lang/webdev/tree/fe-server-integration and also sent out a PR to get frontend_server built with the SDK https://dart-review.googlesource.com/c/sdk/+/130134

@jakemac53
Copy link
Contributor Author

cc @jonahwilliams as well as I have noticed some things we will likely want to change especially in terms of file naming (absolute uris in particular, but also the chosen file extensions).

Any changes will need to be coordinated with flutter_tool.

grouma added a commit that referenced this issue Jan 16, 2020
- Rename `AssetHandler` to `AssetReader` and move to `src/readers`
- Update `AssetReader` API to make clear what resources need to be made available to DWDS
- Rename `BuildRunnerAssetHandler` to `ProxyServerAssetReader`
- Break out `ProxyServerAssetReader` into `proxy_server_asset_reader.dart` and move to `src/readers`
  - Note in the future we will have `FrontendServerAssetReader` with similar functionality
- Move `readAssetOrNull` logic into `ProxyServerAssetReader` as it will likely not apply to the `FrontendServerAssetReader`
- Update `webdev` to adhere to the new API requirements

Towards #865
dart-bot pushed a commit to dart-lang/sdk that referenced this issue Jan 21, 2020
…instead of file uri.

Converts `package:` import uris into `/packages/` modules.

Also renames the output modules to append `.lib.js` instead of just `.js`. This allows us to distinguish between modules and applications based on extension.

Updates DDC source map code to be able to convert absolute file uris in sources so that they are relative to the source map.

Bug: dart-lang/webdev#865
Change-Id: I55d70aa3761f10cc8bd7e92f5b567478040660de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132300
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
grouma added a commit that referenced this issue Jan 21, 2020
- Start building out `FrontendServerAssetReader` for use with the Frontend Server

Towards #865
@grouma grouma mentioned this issue Jan 21, 2020
grouma added a commit that referenced this issue Jan 22, 2020
Implement `dartSourceContents` for the `FrontendServerAssetReader`. 

Towards #865
@jakemac53
Copy link
Contributor Author

Fwiw the initial build timings based on my prototype are looking good here.

I have compiled the angular_components_example app as well as one of our largest internal apps, and it looks like things scale linearly (or even sub-linearly) based on input size, with us being able to compile between 550 and 900 bytes of input code per millisecond on my machine.

dart-bot pushed a commit to dart-lang/sdk that referenced this issue Jan 23, 2020
Also updates StrongComponents to prefer the main component as the root if it is in a cycle. This makes bootstrapping more predictable.

This enables a clean integration of build_runner or ddr (internal) and the frontend_server by allowing it to work with any dev server.

All that is needed is a custom .packages file with `http` uris pointing at a dev server which does all code generation, etc.

Bug: dart-lang/webdev#865
Change-Id: I14533d71e5f7ddac58d98073cf016c2589165e9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132962
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
dart-bot pushed a commit to dart-lang/sdk that referenced this issue Jan 24, 2020
- Allow non-file uris as a multi-root root

resolveInputUri already does what we need, and also supports other types of uris such as http.

This enables us to set a multi-root uri which is actually pointing to a dev server, thus hiding the server uri from generated kernel files.

Bug:dart-lang/webdev#865
Change-Id: I0994df0594d57f5d2f020ecfe3bfc0657771cb74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133083
Commit-Queue: Alexander Aprelev <aam@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
@grouma
Copy link
Member

grouma commented Oct 28, 2020

Can we close this?

cc @annagrin

@jakemac53
Copy link
Contributor Author

jakemac53 commented Oct 29, 2020

I do think we should still do this, it just depends on the prioritization?

@annagrin
Copy link
Contributor

Agreed with @jakemac53 - we might want to come back to it in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:dwds package:webdev type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants