Giter Site home page Giter Site logo

Comments (5)

kylecordes avatar kylecordes commented on June 27, 2024

@julianobrasil Thank you for this excellent feedback!

About the setTimeout(), I have studied this and found that it is not necessary after all. So it is now removed.

I was curious how the Material team avoids setTimeout(), so I searched the code and found that it's actually used somewhat widely. I see the desire to avoid it, but it is not always avoidable, apparently.

About testing, I have been thinking about how to effectively auto-test this code. Right now it is incidentally tested because we use it in various "real work" downstream. But I would like to have a way to test it automatically right here in this repo.

About the notion of a PR - I have constructed this so far to live in "user space" - nowhere near being eligible as a PR. It is not a fork of Angular Material; it does not add any new component as a "peer" of the existing components; etc. Rather, I mentioned originally the idea of a PR for two reasons:

  • If there is any slice of this work which could be useful as a PR, some small bit of it that might be a candidate for inclusion somewhere, then sure, I am happy to help.
  • Maybe a glance at this will provide some modicum of inspiration for an official design process. For example, I have read the design document for the mat-table at length, and putting that together with my experience here, suggests that the DataSource idea might be applicable to this control also (I have made this code use that concept)

About the selectedValueSub - actually that is intentionally omitted from the line you mentioned, both before and after my removal of setTimeout(). It turns out that the asynchronicity of a control like this is a big painful reality. I need better tests to show why this particular bit is necessary. The take(1) ensures the subscription does not last very long and does not leak anything long-term.

from angular-material-search-select.

julianobrasil avatar julianobrasil commented on June 27, 2024

I see the desire to avoid it, but it is not always avoidable, apparently.

Yeah... one thing is what you want... other thing is what is possible to do. 😄

I have constructed this so far to live in "user space"

Oh, now it makes sense. The code seems to be very very organized, but to live in this "user space".

suggests that the DataSource idea might be applicable to this control also

Your code express very well the aplicability of this pattern to this kind of component

I have a lot of autocompletes in some of my projects. All of them making undesired use of setTimeout's and I was waiting for the team to merge Krystian's PR to start replacing them.

As it goes to production environment in the university where I work (I'm a professor in Electrical Engineering course, who accidentaly fell in love with software development), I've imposed to myself to just use "long term" pure angular libraries. Right now I'm using:

  • material
  • dragula: I will likely replace it in 2018 as soon as Material team releases the drag-and-drop features
  • ncstate-sat/popover: based on cdkOverlay, if you don't know it and need a popover (currently out of scope of Material Project), you must visit this repo: https://github.com/ncstate-sat/popover
  • ngx-pagination: I'm about take it away in favor of MatPaginator

As I refactor my autocompletes, if you wish, I can try out your angular-material-obs-autocomplete and let you know more about my impressions on the usability.

from angular-material-search-select.

kylecordes avatar kylecordes commented on June 27, 2024

@julianobrasil I would be thrilled if you would try my component in an application and send me your feedback about the functionality and developer ergonomics. We have several people using it here at work already, but they have the advantage of being able to talk with the person who wrote the code all the time (me), so the feedback from them probably doesn't fully capture whatever difficulties there are in using the code.

Our strategy here is very similar to yours, we avoid mixing in ad hoc non-angular JavaScript code is much as we possibly can, and similarly use as much as possible, the official Angular libraries.

No professors here, but I have personally taught several hundred people Angular, and our group here has taught thousands. ( https://angularbootcamp.com/ )

from angular-material-search-select.

julianobrasil avatar julianobrasil commented on June 27, 2024

That's awesome. Let this issue open so I can use it to give you a feedback in a few days.

from angular-material-search-select.

kylecordes avatar kylecordes commented on June 27, 2024

(Anyone with any similar feedback or questions, please feel free to open a new issue!)

from angular-material-search-select.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.