Discussion:
[dart-misc] How to handle files created by package:build with the Dart analyzer?
Ryan Gonzalez
2018-06-29 15:10:36 UTC
Permalink
I've been getting VueDart up-to-date with Dart 2.0 and the build package,
and so far it's been working well. However, there's one odd problem I've
encountered.

Right now, when a file contains a component definition, the builder creates
a .vue.dart file (since, of course, package:build doesn't allow overwriting
the original file). Now, I've observed some rather odd behavior related to
this:

1. Other files in the same package need to explicitly import the .vue.dart
file. For instance, instead of importing 'my_file.dart', it'll import
'my_file.vue.dart'. The problem, of course, is that the analyzer doesn't
know this file exists, so it causes analysis errors.
2. Files *outside* the package seem to be able to get away with just
importing 'my_file.dart'.

I have two questions from this:

1. For the first point, how should I work around this? I noticed that
AngularDart has its own analysis plugin; does it just change the imports
before the analyzer runs on them?
2. For the second point, why on earth does this happen?
--
Ryan (ラむアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CAO41-mMd7aQnwdibDvkDk4u%3Dbz4Mp_t1xhtUuNgLT95O1ZkBZw%40mail.gmail.com.
Matan Lurey
2018-06-29 18:15:12 UTC
Permalink
Hi Ryan

Generally speaking, you might find more timely responses in the future by
filing bugs on their respective packages.

*I realize these group lists used to be more monitored lively, but the team
is much bigger now and working on disparate parts of the ecosystem*
Post by Ryan Gonzalez
I've been getting VueDart up-to-date with Dart 2.0 and the build package,
and so far it's been working well. However, there's one odd problem I've
encountered.
Right now, when a file contains a component definition, the builder
creates a .vue.dart file (since, of course, package:build doesn't allow
overwriting the original file). Now, I've observed some rather odd behavior
1. Other files in the same package need to explicitly import the
.vue.dart file. For instance, instead of importing 'my_file.dart', it'll
import 'my_file.vue.dart'. The problem, of course, is that the analyzer
doesn't know this file exists, so it causes analysis errors.
We've importing those files as prefixed identifiers, and ignoring the error
<https://github.com/dart-lang/angular/blob/f0bca98d54717be75619a33d9166026f1b0fab99/analysis_options.yaml#L9-L10>
.
Post by Ryan Gonzalez
2. Files *outside* the package seem to be able to get away with just
importing 'my_file.dart'.
1. For the first point, how should I work around this? I noticed that
AngularDart has its own analysis plugin; does it just change the imports
before the analyzer runs on them?
I've mentioned above.

The Dart analysis server just added preliminary support for understanding
the build package (and build cache). If you try the latest SDK, it might
work. If not, feedback or issues files on github.com/dart-lang/build are
appreciated.
Post by Ryan Gonzalez
2. For the second point, why on earth does this happen?
That I am not sure of.
Post by Ryan Gonzalez
--
Ryan (ラむアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/a/dartlang.org/d/msgid/misc/CAO41-mMd7aQnwdibDvkDk4u%3Dbz4Mp_t1xhtUuNgLT95O1ZkBZw%40mail.gmail.com
<https://groups.google.com/a/dartlang.org/d/msgid/misc/CAO41-mMd7aQnwdibDvkDk4u%3Dbz4Mp_t1xhtUuNgLT95O1ZkBZw%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CACtdopg2EF4%3D-36-ReaCRj9fMwuWxPwZu8J8DU%3Dv-3M2Jw6dzg%40mail.gmail.com.
Ryan Gonzalez
2018-07-03 16:47:25 UTC
Permalink
Well, this somehow got buried inside my email...
Post by Matan Lurey
Hi Ryan
Generally speaking, you might find more timely responses in the future by
filing bugs on their respective packages.
*I realize these group lists used to be more monitored lively, but the
team is much bigger now and working on disparate parts of the ecosystem*
Duly noted.
Post by Matan Lurey
Post by Ryan Gonzalez
I've been getting VueDart up-to-date with Dart 2.0 and the build package,
and so far it's been working well. However, there's one odd problem I've
encountered.
Right now, when a file contains a component definition, the builder
creates a .vue.dart file (since, of course, package:build doesn't allow
overwriting the original file). Now, I've observed some rather odd behavior
1. Other files in the same package need to explicitly import the
.vue.dart file. For instance, instead of importing 'my_file.dart', it'll
import 'my_file.vue.dart'. The problem, of course, is that the analyzer
doesn't know this file exists, so it causes analysis errors.
We've importing those files as prefixed identifiers, and ignoring the error
<https://github.com/dart-lang/angular/blob/f0bca98d54717be75619a33d9166026f1b0fab99/analysis_options.yaml#L9-L10>
.
Welp, looks like the .template.dart is hardcoded... I filed
https://github.com/dart-lang/sdk/issues/33750 for that.
Post by Matan Lurey
2. Files *outside* the package seem to be able to get away with just
Post by Ryan Gonzalez
importing 'my_file.dart'.
1. For the first point, how should I work around this? I noticed that
AngularDart has its own analysis plugin; does it just change the imports
before the analyzer runs on them?
I've mentioned above.
The Dart analysis server just added preliminary support for understanding
the build package (and build cache). If you try the latest SDK, it might
work. If not, feedback or issues files on github.com/dart-lang/build are
appreciated.
This doesn't seem to be working, though I definitely want to investigate
this a bit more.
Post by Matan Lurey
2. For the second point, why on earth does this happen?
That I am not sure of.
Post by Ryan Gonzalez
--
Ryan (ラむアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/a/dartlang.org/d/msgid/misc/CAO41-mMd7aQnwdibDvkDk4u%3Dbz4Mp_t1xhtUuNgLT95O1ZkBZw%40mail.gmail.com
<https://groups.google.com/a/dartlang.org/d/msgid/misc/CAO41-mMd7aQnwdibDvkDk4u%3Dbz4Mp_t1xhtUuNgLT95O1ZkBZw%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/a/dartlang.org/d/msgid/misc/CACtdopg2EF4%3D-36-ReaCRj9fMwuWxPwZu8J8DU%3Dv-3M2Jw6dzg%40mail.gmail.com
<https://groups.google.com/a/dartlang.org/d/msgid/misc/CACtdopg2EF4%3D-36-ReaCRj9fMwuWxPwZu8J8DU%3Dv-3M2Jw6dzg%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
--
Ryan (ラむアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CAO41-mMqE6z1hfBbhpXkt16DpbtB%3DLNagtVgUPSiv4Enqx9SSQ%40mail.gmail.com.
Loading...