Code Monkey home page Code Monkey logo

Comments (11)

iamstevendao avatar iamstevendao commented on July 28, 2024

@jdhartley thanks for the suggestion, we will have this in the next release very soon!

from vue-tel-input.

jdhartley avatar jdhartley commented on July 28, 2024

Great to hear Steven! Please let me know if I can help in any way

from vue-tel-input.

jdhartley avatar jdhartley commented on July 28, 2024

@iamstevendao Hey Steven! Any update on this ticket?

from vue-tel-input.

iamstevendao avatar iamstevendao commented on July 28, 2024

@jdhartley Thanks for baring with me, v2.0.2 published along with the fix for this issue.
Demo: https://educationlink.github.io/vue-tel-input/

from vue-tel-input.

iamstevendao avatar iamstevendao commented on July 28, 2024

Although it's still not the best solution, I used the same sprite as the react repo you commented. However, I pointed the image to the static URL link (you can find it at src/assets/sprite.css), which is not a good practice.
We might need to change it later, every contribution is always appreciated.

from vue-tel-input.

jdhartley avatar jdhartley commented on July 28, 2024

Fantastic! Thank you for this update. It has a huge impact on our app's performance.

Would love to chat through options on how we might be able to use our own CDN instead of serving off of GitHub. My fear with using that particular url is its linked to master, so if that image ever changes, people using old versions of the Sprite CSS will run into issues. It may be good to lock to a specific commit sha instead of master, or like in /dist/, add a sha to the filename.

Edit: example of link with commit sha: https://raw.githubusercontent.com/EducationLink/vue-tel-input/c3103c72a17350c2ba4d0d2ad6ff2c1e5727c58e/src/assets/flags.png

from vue-tel-input.

ajmas avatar ajmas commented on July 28, 2024

Would splitting up the flags into individual files help?

from vue-tel-input.

iamstevendao avatar iamstevendao commented on July 28, 2024

@ajmas would you be able to give it a shot? As long as it won't increase the size of all flag images it needs to load.

from vue-tel-input.

ajmas avatar ajmas commented on July 28, 2024

@iamstevendao if I have a bit of time. My next few days aren’t going to allow me to look. I encourage anyone who has a bit of time to look too. Maybe compare what other telephone widgets are doing too, even if they are angular or react based?

from vue-tel-input.

blord-fullscreen avatar blord-fullscreen commented on July 28, 2024

Would splitting up the flags into individual files help?

It would help performance if both:

  • the site is only specifying a subset of the available countries (possibly true in some cases).
  • the images are being requested from an HTTP/2.0 server that can multiplex lots of small files together efficiently in the response. Note that this is currently false for content served from raw.githubusercontent.com, which does not support HTTP/2.0.

In all other cases it will actually hurt perfomance, by ballooning the number of HTTP requests for the same content. This is why image spriting was invented in the first place.

A more flexible, possibly better solution would be a refactor allowing the developer to point to their own image resource(s), with the githubusercontent URL as a default. There could be a root path supplied as a prop, for example, and a toggle for whether the images are supplied as a sprite or as separate images.

Note that all of these refactors are breaking, which makes it all the more important to get the image URL in master to point to a specific commit SHA, as @jdhartley suggested. Otherwise updates will break things.

from vue-tel-input.

ajmas avatar ajmas commented on July 28, 2024

Maybe to allow the images URL to be a configurable option would be a first step? While it doesn’t solve the issue outright, it does allow for a short term solution, for anyone not wanting to point a CDN they don’t control.

from vue-tel-input.

Related Issues (20)

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.