OLD | NEW |
(Empty) | |
| 1 Smoke (and mirrors) |
| 2 =================== |
| 3 |
| 4 Smoke is a package that exposes a reduced reflective system API. This API |
| 5 includes accessing objects in a dynamic fashion (read properties, write |
| 6 properties, and call methods), inspecting types (for example, whether a |
| 7 method exists), and symbol/string convertion. |
| 8 |
| 9 The package provides a default implementation of this API that uses the system's |
| 10 mirrors, but additionally provides mechanisms for statically generating code |
| 11 that can replace the mirror-based implementation. |
| 12 |
| 13 The intention of this package is to allow frameworks to use mirrors in a way |
| 14 that will not impose on their users. The idea is that users will not worry about |
| 15 how to preserve symbols when compiling with dart2js (for instance, using the |
| 16 `MirrorsUsed` annotation). Instead, this package provides the building blocks |
| 17 to autogenerate whatever is needed for dart2js to be happy and to generate |
| 18 reasonable code. |
| 19 |
| 20 Note this package alone doesn't know how to generate everything, but it provides |
| 21 a simple API that different frameworks can use to define what needs to be |
| 22 generated. |
| 23 |
| 24 |
| 25 Smoke reflective API |
| 26 ==================== |
| 27 |
| 28 Use `package:smoke/smoke.dart` in your framework to read and write objects and |
| 29 to inspect type information. Read the Dart-docs for more details. |
| 30 |
| 31 Code Generation |
| 32 =============== |
| 33 |
| 34 TBD. We envision we'll have a base transformer class that can be tailored to |
| 35 create a transformer for your framework. |
OLD | NEW |