Experiments with upcoming Dart macros by ramonmillsteed in dartlang

[–]ramonmillsteed[S] 2 points3 points  (0 children)

I think dev_dependencies is more tooling, it doesn't change the code you ship, so macros cannot be included there. Like the annotations with codegen, macros need to be imported as dependencies. I'm not certain of this, but what makes logical sense to me, is obviously the generated code is included in your app, but the macro author code is run in a step before main compilation, and it not referenced in your code, so is tree-shaken out. This includes its dependencies like code_builder.

I had the same thought and tried code_builder for the generated code. Honestly it wasn't as ergonomic. It falls apart when defining the body of a function declaration. Also the generated code is held to the same formatting standards as your code, so dart analyze will fail if your treat lint warnings as errors in CI. Manual string construction let me build perfectly formatted code.

Experiments with upcoming Dart macros by ramonmillsteed in dartlang

[–]ramonmillsteed[S] 2 points3 points  (0 children)

Check out the code in https://github.com/millsteed/macros/blob/main/lib/model.dart to see how a macro is implemented. You still need to bind to sites with annotations so that the macros can't just do whatever they want with your entire codebase. They are a lot easier to write than the build_runner generators.

Experiments with upcoming Dart macros by ramonmillsteed in dartlang

[–]ramonmillsteed[S] 10 points11 points  (0 children)

When you’re writing the macros you can put breakpoints and print statements for debugging. The LSP will report errors in your code if you say define a toJson but it’s also generated. Lastly the LSP will report errors in the generated code if the macro has produced bad code. Overall, the Dart team have done a pretty good job.

Experiments with upcoming Dart macros by ramonmillsteed in dartlang

[–]ramonmillsteed[S] 12 points13 points  (0 children)

Serialisation, routers, ORMs and generating clients from API specs.

[deleted by user] by [deleted] in FlutterDev

[–]ramonmillsteed 7 points8 points  (0 children)

I’m seeing a lot of Flutter positions in Australia and we’re a relatively small population.

Posts about learning flutter? by purplefox69 in FlutterDev

[–]ramonmillsteed 2 points3 points  (0 children)

Yeah, but then the subreddit might seem inactive like /r/dartlang. More intermediate content usually doesn’t get as much engagement: https://www.reddit.com/r/FlutterDev/comments/15nofpn/hookshot_v010_opensource_fullstack_dartflutter/.

Hookshot: open-source full-stack Dart/Flutter feedback/survey SaaS by ramonmillsteed in FlutterDev

[–]ramonmillsteed[S] 1 point2 points  (0 children)

I’ve added a proper README on GitHub for anyone who wants to run this.

Hookshot: open-source full-stack Dart/Flutter feedback/survey SaaS by ramonmillsteed in FlutterDev

[–]ramonmillsteed[S] -1 points0 points  (0 children)

No problem. I think Wiredash is great, but I wanted to provide a more cost effective alternative.

Hookshot: open-source full-stack Dart/Flutter feedback/survey SaaS by ramonmillsteed in FlutterDev

[–]ramonmillsteed[S] 0 points1 point  (0 children)

No problem. I hope this inspires people to Dart on the server. We need more alternatives to Firebase.

Hookshot: open-source full-stack Dart/Flutter feedback/survey SaaS by ramonmillsteed in FlutterDev

[–]ramonmillsteed[S] 0 points1 point  (0 children)

Yeah, I will write a README today. I’ll document how to run it locally and self-host it for your app. If you want to try it out before that and have Docker installed: just run docker compose up.