Dart repointer (reptr
) puts the sharp part in your Dart aims to facilitate fast code generation for Dart. It consists of the tool itself and a Dart parser library.
build_runner
-based code generation for a single package can take a couple minutes. This translates to unreasonably long code generation time for large Dart and Flutter projects (e.g. over 45 minutes 🤯). This is predominantly due to inefficiencies in the code generation infrastructure, the build_runner
. A faster implementation should allow 20–50x speed-up.
The key components of this project that are already functional are:
flowchart LR
CLI --> Scanner[F/s scanner] --> Loader --> Parser["Parser\n(lexerless)"] --> Gen1 & Gen2 --> Combiner --> Writer --> Formatter[External formatter]
CLI --> Reporter[Status / progress reporter]
CLI --> Watcher[F/s watcher]
subgraph Generator 1
Gen1[...]
end
subgraph Generator 2
Gen2[...]
end
style Reporter stroke-dasharray: 5 5
style Watcher stroke-dasharray: 5 5
style Gen1 stroke-dasharray: 5 5
style Gen2 stroke-dasharray: 5 5
style Combiner stroke-dasharray: 5 5
style Writer stroke-dasharray: 5 5
style Formatter stroke-dasharray: 5 5
&str
) is extremely cheap (doesn't cause memory allocation), so take advantage of thatVec
and co.)import
, not whitespaceimport 'dart:math';\n\n
do not consume \n\n
)