Skip to content

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

Closed
@leafpetersen

Description

@leafpetersen

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

cc @franklinyow @sigmundch @mit-mit

Activity

sigmundch

sigmundch commented on Feb 11, 2021

@sigmundch
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

grouma commented on Feb 11, 2021

@grouma
Member

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

added
area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.
on Feb 24, 2021
leafpetersen

leafpetersen commented on Mar 12, 2021

@leafpetersen
MemberAuthor

@grouma do we have a plan for validating this?

grouma

grouma commented on Mar 12, 2021

@grouma
Member

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

sigmundch commented on Mar 16, 2021

@sigmundch
Member

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

grouma

grouma commented on Mar 16, 2021

@grouma
Member

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

added
P1A high priority bug; for example, a single project is unusable or has many test failures
on Mar 18, 2021
leafpetersen

leafpetersen commented on Mar 26, 2021

@leafpetersen
MemberAuthor

@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

grouma commented on Mar 29, 2021

@grouma
Member

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

franklinyow

franklinyow commented on Apr 1, 2021

@franklinyow
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

leafpetersen commented on Apr 3, 2021

@leafpetersen
MemberAuthor

@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

grouma commented on Apr 5, 2021

@grouma
Member

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

leafpetersen commented on Apr 5, 2021

@leafpetersen
MemberAuthor

@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

grouma commented on Apr 5, 2021

@grouma
Member

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

leafpetersen commented on Apr 5, 2021

@leafpetersen
MemberAuthor

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

grouma

grouma commented on Apr 5, 2021

@grouma
Member

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

scheglov commented on Apr 5, 2021

@scheglov
Contributor

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

natebosch

natebosch commented on Apr 5, 2021

@natebosch
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

grouma commented on Apr 5, 2021

@grouma
Member

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

leafpetersen commented on Apr 6, 2021

@leafpetersen
MemberAuthor

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

Metadata

Metadata

Assignees

Labels

P1A high priority bug; for example, a single project is unusable or has many test failuresarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.language-nonfunction-type-aliasesIssues related to non-function type aliases

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @scheglov@grouma@sigmundch@natebosch@leafpetersen

      Issue actions

        Implement non-function type alias support in web debuggers · Issue #44963 · dart-lang/sdk