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

Implement non-function type alias support in web debuggers #44963

Closed
leafpetersen opened this issue Feb 11, 2021 · 19 comments
Closed

Implement non-function type alias support in web debuggers #44963

leafpetersen opened this issue Feb 11, 2021 · 19 comments
Assignees
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. language-nonfunction-type-aliases Issues related to non-function type aliases P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@leafpetersen
Copy link
Member

This issue tracks support of the non-function type alias feature. See the enclosing meta-issue for details.

cc @franklinyow @sigmundch @mit-mit

@sigmundch
Copy link
Member

I don't believe there is any specific work required for this, other than validating that the feature works as expected.

@jacob314 @grouma - do you agree?

@grouma
Copy link
Member

grouma commented Feb 11, 2021

Yeah I think we just need to validate that it works and if it doesn't, likely make edits to the logic here.

@eernstg eernstg added the language-nonfunction-type-aliases Issues related to non-function type aliases label Feb 23, 2021
@mit-mit mit-mit added the area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. label Feb 24, 2021
@leafpetersen
Copy link
Member Author

@grouma do we have a plan for validating this?

@grouma
Copy link
Member

grouma commented Mar 12, 2021

I think making use of the feature in a package:dwds smoke test, along with some specific VM Service protocols, should give us enough confidence.

@sigmundch
Copy link
Member

Maybe it is worth also adding a couple tests to cover #44925 as well?

@grouma
Copy link
Member

grouma commented Mar 16, 2021

Wouldn't hurt. We'll need to know the SDK version that contains these features.

@sigmundch sigmundch added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Mar 18, 2021
@leafpetersen
Copy link
Member Author

@grouma this will be released in 2.13 are you waiting on a dev build or can you go ahead and validate? This CL can be patched in to build a version with the feature on by default.

@grouma
Copy link
Member

grouma commented Mar 29, 2021

Ping me when a dev build is available. It's much easier to validate that way.

@franklinyow
Copy link
Contributor

It seems we won't have a dev build this week due to Easter holiday in Europe , can we validate with the CL?

@leafpetersen
Copy link
Member Author

@grouma this has landed, can you please test on master (I don't expect we will have a dev build before the branch cut window opens).

@grouma
Copy link
Member

grouma commented Apr 5, 2021

I downloaded the latest SDK:
Dart SDK version: 2.13.0-203.0.dev (dev) (Mon Apr 5 09:39:33 2021 -0700) on "macos_x64"

I updated the minimum SDK for my example project and included this:

typedef JsonMap = Map<String, dynamic>;

There are no errors with analysis, however I'm having issues building:

[SEVERE] build_web_compilers:entrypoint on web/main.dart: This builder requires Dart inputs without syntax errors.
However, asset:webdev_example_app/web/main.dart (or an existing part) contains the following errors.
main.dart:11:17: Invalid generic function type.

Try fixing the errors and re-running the build.


[INFO] Running build completed, took 3.7s
[INFO] Caching finalized dependency graph completed, took 180ms
[SEVERE] Failed after 3.9s
[INFO] ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

cc @jakemac53

Without being able to build it's impossible for me to validate.

@leafpetersen
Copy link
Member Author

@grouma This is not in any dev build and I don't think it will be until AAR is back from vacation which will be too late. I think you need to test this out on master.

@grouma
Copy link
Member

grouma commented Apr 5, 2021

I'll build from master locally but I'm confused as to why this isn't in the latest raw SDK. I thought raw corresponded to master. The given timestamp says it was built this morning. Correct my understanding.

@leafpetersen
Copy link
Member Author

@grouma is this a pkg:analyzer issue then? You may need a version of pkg:analyzer with this enabled - cc @scheglov .

@grouma
Copy link
Member

grouma commented Apr 5, 2021

I don't think this is an analyzer issue. There are no analysis errors. (There were some until I upgraded the SDK and updated the pubspec). I think this may be a package:build issue. cc @natebosch

@scheglov
Copy link
Contributor

scheglov commented Apr 5, 2021

FYI, I'm waiting for the flag switch to be rolled into google3, and will publish package:analyzer then.

@natebosch
Copy link
Member

@grouma webdev serve works for me.

I had to ensure that the language version is 2.13, and use a dependency_override on analyzer from my local SDK checkout since it isn't published yet. It also took a few other overrides to get a valid solve. Here is the pubspec I used in a project where this worked:

name: dart_repro

environment:
  sdk: ">=2.13.0-0 <3.0.0"

dev_dependencies:
  build_runner: any
  build_web_compilers: any

dependency_overrides:
  analyzer:
    path: ../dart-sdk/sdk/pkg/analyzer
  front_end:
    path: ../dart-sdk/sdk/pkg/front_end
  _fe_analyzer_shared:
    path: ../dart-sdk/sdk/pkg/_fe_analyzer_shared
  package_config: 2.0.0

@grouma
Copy link
Member

grouma commented Apr 5, 2021

Thanks @natebosch, I was able to get it working.

Debugging doesn't blow up so that's good. I'm not sure what the intended behavior is here though. The displayed types are desugared. Look at the variables and console in the screenshot below. I suppose that's the desired behavior?

Screen Shot 2021-04-05 at 4 31 52 PM

@leafpetersen
Copy link
Member Author

Expanding the types seems like fine behavior to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. language-nonfunction-type-aliases Issues related to non-function type aliases P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

8 participants