google / reflectable.dart

Reflectable is a Dart library that allows programmers to eliminate certain usages of dynamic reflection by specialization of reflective code to an equivalent implementation using only static techniques. The use of dynamic reflection is constrained in order to ensure that the specialized code can be generated and will have a reasonable size.
https://pub.dev/packages/reflectable
BSD 3-Clause "New" or "Revised" License
374 stars 56 forks source link

Update reflectable to use build_resolver 2.1.0 #295

Closed eernstg closed 1 year ago

eernstg commented 1 year ago

This PR changes reflectable such that it does not consider 'dart:html' as a library which can be imported by generated code. This used to be the case anyway, but build_resolvers 2.1.0 has added 'dart:html' to resolver.libraries, and this causes reflectable to generate code that imports 'dart:html' (and it has no notion about being on a platform where that library does or does not exist). Hence, this change preserves the behavior we have had until now.

The PR removes the workaround which was needed as described in https://github.com/google/reflectable.dart/issues/269. The InconsistentAnalysisException does not seem to occur any longer.

The PR also prepares reflectable for being released as version 4.0.2.