Code generation experience needs improvements
## Use case Code generation has became a big part of flutter development, I'm currently using it for: 1. Generating i18n strings. 2. Generating asset paths. 3. Generating json parsing. 4. Generating moor database handling. Unfortunately, the experience related to code generation is not as good as it should be: 1. Code generated files are checked by analyzer for styling problems. 2. I need to setup build_runner for every project and tell people how to use it. 3. I need to remember to run build_runner. 4. Build runner takes many seconds to build. 5. During build process, generated code gets deleted, and analyzer errors are being displayed. 6. Using a code generator requires boilerplate setup for each class: a. Adding part directive. b. Adding factory methods that delegate constructors to the generated class. 7. Generated files pollute my project's workspace, project wide text search returns results from generated code. 8. Analysis exclude does not work properly: https://github.com/dart-lang/sdk/issues/25551, and if it worked properly, then I would not see errors. I am aware that some of these problems have partial solutions, such as using snippets, configuring IDE to run build_runner task, and so on. I just don't think it's good enough if everyone who uses code generation needs to do it on their own. ## Proposal Code generation should be completely seamless. Below are my suggestions that would achieve this. I realize that some of them may be infeasible. 1. Code generat
Posted by szotp on Aug 9, 2020, 11:01 AM
Tags
Related issues
Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments
onboarding (Software)
Minecraft Dungeons II (1912410)
We are seeing the realtime result of MS buying Github and buying influence.
macOS 15 Sequoia clobbers _nixbld1-4 users
News + Polls
Implement Pylint
Add Zig
Unable to run sandboxed process when run as elevated under applocker
[Feature request] Show browser error overlay for runtime errors
Code generation experience needs improvements
## Use case Code generation has became a big part of flutter development, I'm currently using it for: 1. Generating i18n strings. 2. Generating asset paths. 3. Generating json parsing. 4. Generating moor database handling. Unfortunately, the experience related to code generation is not as good as it should be: 1. Code generated files are checked by analyzer for styling problems. 2. I need to setup build_runner for every project and tell people how to use it. 3. I need to remember to run build_runner. 4. Build runner takes many seconds to build. 5. During build process, generated code gets deleted, and analyzer errors are being displayed. 6. Using a code generator requires boilerplate setup for each class: a. Adding part directive. b. Adding factory methods that delegate constructors to the generated class. 7. Generated files pollute my project's workspace, project wide text search returns results from generated code. 8. Analysis exclude does not work properly: https://github.com/dart-lang/sdk/issues/25551, and if it worked properly, then I would not see errors. I am aware that some of these problems have partial solutions, such as using snippets, configuring IDE to run build_runner task, and so on. I just don't think it's good enough if everyone who uses code generation needs to do it on their own. ## Proposal Code generation should be completely seamless. Below are my suggestions that would achieve this. I realize that some of them may be infeasible. 1. Code generat
Comments (0)
No comments yet. Start the discussion.