dart-lang / pub-dev

The pub.dev website
https://pub.dev
BSD 3-Clause "New" or "Revised" License
790 stars 146 forks source link

flame does not show up as a "flutter" package #562

Closed eseidelGoogle closed 7 years ago

eseidelGoogle commented 7 years ago

https://pub.dartlang.org/packages/flame

Note it has no Flutter logo shown. @kevmoo (I hope this was the right repo to file in.)

isoos commented 7 years ago

@eseidelGoogle: analysis shows an error: Error(s) in lib/util.dart: The class 'ServicesBinding' can't be used as a mixin because it extends a class other than Object. (line:40, col:46). Only packages without errors get platform classification.

kevmoo commented 7 years ago

@eseidelGoogle – the v2 work includes making these types of issues easy to debug. The bits @isoos are available for authors – just obscured at the moment

eseidelGoogle commented 7 years ago

FYI @luanpotter

luanpotter commented 7 years ago

@eseidelGoogle, thanks for noticing and letting me know :)

So, this is weird indeed, because I ran both flutter analyze and flutter packages pub publish --dry-run and neither gave me any errors nor warnings whatsoever. How could I be able to get a log of these obscured errors, as you put it?

As regards the error itself, I don't really understand it, it seems that Dart 1.13 "supports mixins that can extend from classes other than Object" [1]. Now admittedly my min SDK version was 1.8, so I bumped that up, and yet, no logo. It also required the --supermixin flag, and I don't know if that is used or not in this hidden analysis PUB is performing.

Note that what I'm trying to achieve is not without precedent, as it's done by flutter itself:

class WidgetsFlutterBinding extends BindingBase with SchedulerBinding, GestureBinding, ServicesBinding, RendererBinding, WidgetsBinding {
    // ...
}

On line 847 of flutter/lib/src/widgets/binding.dart.

Forgive me for my understanding of Dart's mixins (and the language itself) is rather limited yet.

isoos commented 7 years ago

The simplest way to debug what is happening or missing is to add the following analysis_options.yaml file to your project:

analyzer:
  strong-mode: true

# Source of linter options:
# http://dart-lang.github.io/linter/lints/options/options.html

linter:
  rules:
    - camel_case_types
    - hash_and_equals
    - iterable_contains_unrelated_type
    - list_remove_unrelated_type
    - unrelated_type_equality_checks
    - valid_regexps

and run dartanalyzer . in the project root. It'll list the errors and warnings that we are looking at, and if there is a pending error, please fix it.

eseidelGoogle commented 7 years ago

@kevmoo Do we need a bug about making those above analyzer options the ones default for pub publish to let authors know of these failures before upload? (or maybe you already have another solution planned).

kevmoo commented 7 years ago

Please file an issue on the pub client – 'dart-lang/pub' – for that.

pkg/pana is public – so folks can run this analysis now. We'll need to ponder if it makes sense to integrate pub + pana

On Mon, Nov 13, 2017 at 6:46 AM, Eric Seidel notifications@github.com wrote:

@kevmoo https://github.com/kevmoo Do we need a bug about making those above analyzer options the ones default for pub publish to let authors know of these failures before upload? (or maybe you already have another solution planned).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dart-lang/pub-dartlang-dart/issues/562#issuecomment-343940757, or mute the thread https://github.com/notifications/unsubscribe-auth/AABCivzLnm0djtIsr9p5FlXEAJHpvFhnks5s2FZLgaJpZM4QbDCl .

isoos commented 7 years ago

Issues in the package analysis may occur not only at package upload time, it may be that a dependency of the package changes in a breaking way, or a new version of the SDK, flutter or pana uncovers or changes something.

A larger package may take a minute or more to get analyzed, and I think it is better to keep it optional. The goal should be to expose the issues and the steps to fix them on the pub site, and everybody can decide when to do it.

isoos commented 7 years ago

@luanpotter fixed the supermixin in the code, but there are other errors with the current repo. I've submitted https://github.com/luanpotter/flame/pull/2 to help fixing the issues. Once they are fixed, a new version should show up as flutter package.