angulardart-community / angular

Fast and productive web framework provided by Dart.
https://pub.dev/packages/ngdart
MIT License
114 stars 14 forks source link

AngularDart 8 Roadmap #6

Open GZGavinZhao opened 2 years ago

GZGavinZhao commented 2 years ago

This is an incomplete list that I can think of on the top of my head, and I'll come back here to add more things. Feel free to suggest anything more!

For now, I don't expect there to be breaking changes in existing codebases that are using null safety.

ykmnkmi commented 2 years ago

Old pipes and animations in Component?

ykmnkmi commented 2 years ago

Can we also deprecate and remove ReflectiveInjector, bootstrapStatic, runAppLegacy and runAppLegacyAsync? How it would look.

GZGavinZhao commented 2 years ago

@ykmnkmi I'm okay with that. Feel free to send in a PR!

insinfo commented 2 years ago

@GZGavinZhao Congratulations for your dedication to this project, I would particularly like to be contributing to this project but I haven't had the time. I deal with AngularDart projects on a day to day basis, but at the company where I work we still have a lot of projects stuck in AngularDart 6 and dart 2.12. I really appreciate the idea of not being stuck with AngularDart Components (MaterialDesign), I use a lot of custom components that make use of CSS Bootstrap.

ykmnkmi commented 2 years ago

@GZGavinZhao looking at the "Fix all static analysis warnings" and "constant_identifier_names" rule (152 cases), can I deprecate public members with names like this "OnPush" and replace them with new ones?

GZGavinZhao commented 2 years ago

@ykmnkmi No problem, go for it :)

ykmnkmi commented 1 year ago

@GZGavinZhao I thinks analyzer warnings task is done. What you think about migrating all packages and tests to Dart 3 and analyzer 6?

GZGavinZhao commented 1 year ago

@GZGavinZhao I thinks analyzer warnings task is done. What you think about migrating all packages and tests to Dart 3 and analyzer 6?

@ykmnkmi Good idea! The only caution I would have is that if we migrate to Dart 3, we either have to remove non-null-safe support entirely, or find a way to disable/isolate it during testing. In my opinion, the 2nd option is more desirable, but I'm not sure how difficult it would be. If the 2nd option is not possible, then we will likely have to remove non-null-safety support from AngularDart.

Side note, Angular's runtime code is already theoretically compatible with Dart 3 as indicated by the Pub packages page and it seems that @jodinathan was able to get it working as well; the only potential blocker here is the Angular Compiler, as explained in the previous paragraph.

ykmnkmi commented 1 year ago

Currently, I'm bumping all package versions to the minimal version that has migrated to Dart 3.0 or the latest pre-3.0 version and fixing errors and analysis warnings.

For example:

# ngtest/pubspec.yaml
dependencies:
  collection: ^1.17.2
  # ...

dev_dependencies:
  build_runner: ^2.4.6
  build_test: ^2.2.0
  build_web_compilers: ^4.0.4
  test: ^1.24.4
  # ...

One package that is holding up migration is mockito, as I am waiting for it to update. It's a dev dependency in ngforms, ngrouter, and _tests.

insinfo commented 1 year ago

@ykmnkmi @GZGavinZhao

Is it possible to keep AngularDart 8 compatible with dart 2.18, 2.19 and 3? I'm asking this because many of my projects are stuck on dart 2.18.x at the moment

ykmnkmi commented 1 year ago

@insinfo I think it would be better to backporting updates to v7.x branch, keeping it with Dart 2.x and analyzer 5.x build stack.

insinfo commented 1 year ago

@ykmnkmi I'm working on bringing some of the projects to dart 3.1.5, due to a bug I found in dart 2.18.* but from what I've seen, ngdart 8.0.0-dev.0 still doesn't work with dart 3, right? What package prevents AngularDart from working with Dart 3?

ykmnkmi commented 1 year ago

@insinfo dart-lang/mockito#706 and tests in _tests, ngforms and ngrouter.

insinfo commented 1 year ago

I forked ngdart here to try to make it work on dart 3.1.5, made some dependency changes, set it to sdk: '>=3.0.0 <4.0.0', and made modifications to the mixins classes and it seems to be working well on dart 3.1.5 in a large project. I have no knowledge of the structure of the angular project, I don't know what the "goldens" package and the "_tests" package are, I ran the "ngast" and "ngcompiler" package tests and it passed all the tests

https://github.com/insinfo/angular_8 https://www.youtube.com/watch?v=LruIQZ77GIw

insinfo commented 1 year ago

the "ngforms", "ngrouter", "ngast" and "ngcompiler" package could be integrated with the "ngdart" package to reduce dependencies on many packages and facilitate maintenance in just one package

GZGavinZhao commented 1 year ago

@insinfo @ykmnkmi and I have been working on #68, where functionality wise it is working (browser tests all passed) but we're still fixing tests (compiler tests in _tests were failing because of null-safety issues).

insinfo commented 12 months ago

the "ngforms", "ngrouter", "ngast" and "ngcompiler" package could be integrated with the "ngdart" package to reduce dependencies on many packages and facilitate maintenance in just one package

I did a proof of concept here, I modified the ngdart package to include the ngast, ngcompiler, ngforms, ngrouter and ngtest packages. And I used it on the project I'm working on and it seems to be working well. now my project depends on just one package

image https://github.com/insinfo/angular_8 image

ykmnkmi commented 11 months ago

@Insinfo, I also think about it. As for goldens, I use goldens to view changes in generated JS in the process of changing AngularDart internals.

dukefirehawk commented 10 months ago

For those that would like to run ngdart with dart 3.2, I use the following pubspec.yml in my project without any issues. Granted I don't use ngcomponents. Instead use Bulma with ngdart. Light weight and works seamlessly.

name: myportal
version: 1.0.0
description: An ngdart web portal
publish_to: none
environment:
  sdk: ">=3.0.0 <4.0.0"
dependencies:
  ngdart: ^8.0.0-dev.2
  ngrouter: ^4.0.0-dev.1
  ngforms: ^5.0.0-dev.1
  crypto: ^3.0.1
dev_dependencies:
  ngtest: ^5.0.0-dev.0
  build_runner: ^2.1.2
  build_test: ^2.1.3
  build_web_compilers: ^4.0.0
  test: ^1.16.5
  sass_builder: ^2.1.3
  webdev: ^3.0.0
  lints: ^3.0.0
dependency_overrides:
  build_modules: ^5.0.0
insinfo commented 9 months ago

@duquefirehawk

If you overwrite only the build_modules package, a warning message will appear, so that this message does not appear, you must also overwrite the analyzer package

[WARNING] ngdart on web/main.dart: Your current `analyzer` version may not fully support your current SDK version.

Analyzer language version: 3.1.0
SDK language version: 3.2.0

Please update to the latest `analyzer` version (6.4.1) by running
`dart pub upgrade`.

If you are not getting the latest version by running the above command, you
can try adding a constraint like the following to your pubspec to start
diagnosing why you can't get the latest version:

dev_dependencies:
  analyzer: ^6.4.1
environment:
  sdk: ^3.2.1

dependencies:
  ngdart: ^8.0.0-dev.2
  ngrouter: ^4.0.0-dev.1
  ngforms: ^5.0.0-dev.1 

dev_dependencies:  
  build_runner: ^2.1.2
  build_test: ^2.1.3
  build_web_compilers: ^4.0.0
  lints: ^2.1.0
  test: ^1.24.0

dependency_overrides:
  build_modules: ^5.0.0
  analyzer: ^6.4.1
GZGavinZhao commented 9 months ago

Oh well I guess it's time for a pre-release for Dart 3. I will publish one this weekend.

dukefirehawk commented 9 months ago

Maybe a pre-release for ngcomponents too while you are at it :)

GZGavinZhao commented 9 months ago

Dart 3 pre-release has been published, version are as follows:

dependencies:
  ngdart: 8.0.0-dev.4
  ngrouter: 4.0.0-dev.3
  ngforms: 5.0.0-dev.3

dev_dependencies:
  ngtest: 5.0.0-dev.3

# internal packages
others:
  ngast: 3.0.0-dev.2
  ngcompiler: 3.0.0-dev.3

Will publish a pre-release ngcomponents shortly.