Code Monkey home page Code Monkey logo

Comments (6)

rehandalal avatar rehandalal commented on May 23, 2024

sounds like an interesting idea. just a couple of thoughts:

  • I don't want to go overboard littering the request object with new attributes. Maybe there's a cleaner way of implementing what's there.
  • Your fork removes the ability to force the mobile view using a cookie. I don't want to lose that.
  • Would likely want to create new decorators or extend the functionality of the current decorators to accommodate some of the new features.

also feel free to submit a pull request so that it's easier to compare the changes.

from flask-mobility.

wodow avatar wodow commented on May 23, 2024

Thanks for the fast reply!

I should have been clearer about the removal of the cookies code (and the lack of a PR) - I did it to simplify the proof-of-concept (which I have running locally).

I am more than happy to submit a proper, cleanly edited PR with additional decorators if you are interested.

My main question is: are you happy to have a dependency on user-agent? Or should it be optional somehow?

Re the new attributes on the request object: I considered introducing a second level of access, e.g. request.MOBILITY.TABLET or request.MOBILITY.is_mobile but this would not be backwards-compatible with existing deployments using request.MOBILE.

Is that an issue? A compromise would be to introduce something like request.MOBILITY but retain request.MOBILE (which would be aliased to e.g. request.MOBILITY.is_mobile).

from flask-mobility.

rehandalal avatar rehandalal commented on May 23, 2024

Sorry about the delay getting back to you.

I'm fine with making user-agent a dependency. It would be nice to have it be optional, but that's not a deal breaker for me.

I would like to ensure this stays backwards compatible so I like the idea of having request.MOBILE and request.MOBILITY.

Thanks!

from flask-mobility.

wodow avatar wodow commented on May 23, 2024

Thanks for the thumbs up. I will aim to pull something when I next make a related change in the client webapp, so can't be sure of a timeline just yet.

I will try to make user-agent optional as a secondary goal.

from flask-mobility.

helielson avatar helielson commented on May 23, 2024

I thought about make the same thing using the user-agent lib.
It's really an interesting idea.
What about the PR @wodow? Are you still think to integrate it?
Let me know if you are needing some help.

from flask-mobility.

rehandalal avatar rehandalal commented on May 23, 2024

@helielson i might get around to adding this in the next few weeks

from flask-mobility.

Related Issues (12)

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.