rodydavis / signals.dart

Reactive programming made simple for Dart and Flutter
http://dartsignals.dev
Apache License 2.0
437 stars 50 forks source link

Update examples dependencies and fix lints #246

Closed robsonsilv4 closed 5 months ago

robsonsilv4 commented 5 months ago

This pull request updates the dependencies, Dart, and Flutter constraints of all examples.

Benchmark constraints and dependencies are updated too. And update the lock dependencies of these packages examples:

Additionally, fix all possible examples of lint rules.

robsonsilv4 commented 5 months ago

Hi @rodydavis, I'm having this problem when trying to generate the code for drift_example:

[WARNING] .dart_tool/build/entrypoint/build.dart:6:8: Error: Error when reading 'tool/builder.dart': No such file or directory
import '../../../tool/builder.dart' as _i4;
       ^
.dart_tool/build/entrypoint/build.dart:43:10: Error: Undefined name 'CopyCompiledJs'.
    [_i4.CopyCompiledJs.new],
         ^^^^^^^^^^^^^^
.dart_tool/build/entrypoint/build.dart:43:25: Error: 'new' can only be used as a constructor reference.
    [_i4.CopyCompiledJs.new],
                        ^^^
[INFO] Precompiling build script... completed, took 983ms
[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.

Did you already have a similar problem or know how to fix it?

CC: @simolus3

I'm using:

• Flutter version 3.19.5 on channel stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 300451adae (3 weeks ago), 2024-03-27 21:54:07 -0500
• Engine revision e76c956498
• Dart version 3.3.3
• DevTools version 2.31.1
rodydavis commented 5 months ago

Haven't seen that one before! But definitely run flutter clean for sure

robsonsilv4 commented 5 months ago

Already tried it, but I get the same error. The error is happening in the main branch as well.

I will try out a previous version of Flutter and report back...

robsonsilv4 commented 5 months ago

The same applies to Flutter version 3.19.6 and previous version 3.16.9. Should I open an issue with this? @rodydavis

Steps to reproduce:

cd examples/drift_example

flutter clean
flutter pub get
dart run build_runner build --delete-conflicting-outputs
simolus3 commented 5 months ago

The example appears to have been adapted from an example in the drift repository, but it's missing this file causing build failures.

You can add that file to fix the build, or download a prebuilt drift_worker.js from the releases and drop it into web/. Or, if web support is not particularly important for that example, remove the build.yaml and don't support running it on the web.

robsonsilv4 commented 5 months ago

Thank you, @simolus3, this is precisely the problem. I added the file and builder dependencies to complete the example port:

[INFO] Running build completed, took 36.6s
[INFO] Caching finalized dependency graph completed, took 533ms
[INFO] Succeeded after 37.2s with 2463 outputs (8926 actions)

@rodydavis, you can look at the PR when you have some time 🚀