-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion: iro.js 4.0+ #30
Comments
I already wrote an wrapper for iro.js for Vue. If you wan't I can share my single File Component with you. |
Sure thing @adrianjost! I was actually hoping to use Vue to render the SVG ui as well, but I'll take a look :> |
My current implementation can be found here: https://github.com/adrianjost/SmartLight-Firebase/blob/master/src/components/iro.vue |
Thank for your iro.js. This is awesome. |
@thuyettiensinh I'm not sure I understand, you want to get the (Also, thank you very much for the kind words!) |
I can get |
Figured I should give an update on the 4.0 progressL Right now solving complex layouts is proving to be a major roadblock. With SVG everything has to be given explicit positions, there's nothing like css flexbox or grids. The way iro does layout is already messy (like, really messy), and it would get even worse if certain requests are implemented, such as alternate layout directions (#19), the option to remove the slider completely (#33, #10, #13), responsive layouts (#32), or extra elements(#22, #17) I'll work something out, just might take a while. :P |
Small update: I just pushed version 3.5.0, which rewrites API classes in the cleaner es6 class syntax, and moves the build process over to bili. I hope this might encourage others to consider contributing to iro's development so that v4 can happen. :) |
I have also written an Angular Module which is now being used internally in our project but I can make it public if it's interesting. |
@mhadaily Sure! I personally haven't used Angular before so I think it might be helpful. :) |
Another update: I'm thinking about overhauling the UI code and rewriting it with Preact! This is mainly because I keep hitting roadblocks with the internal SVG lib, and I think it needs to go. There's some things to consider: Pros:
Cons:
That said, I would love to hear some thoughts on this from devs with more production experience. :) |
I personally suggest keeping your library purely in Javascript. 1- as you said it's lightweight Of course, it's up to you to make a decision, I just suggest what I think 😄 |
Thanks for the feedback @mhadaily! I think there may be a couple of misconceptions though, sorry if I wasn't clear enough ':)
It will still be compiled to pure JS, just with preact's core bundled in -- everything on the surface will be exactly the same!
The current internal dom library really isn't suitable for a lot of things. For example, I'd like to be able to resize the color wheel after the initial render, but this requires the whole UI to be fully recalculated and redrawn in order to work properly. Simply passing new sizes to each UI component for them to rerender themselves would be far less complicated than manually changing different attributes with the current lib. :)
It's only 7KB if gzip is used! I agree that this is maybe a bit much for a "lightweight" color picker widget. I'd love for iro.js to stay minimal, but I think a lot of people like the library for how it looks, not the small filesize, and they expect to be able to customise it more. If it becomes too heavy we could always branch off a "lite" version of the library that just has the basic features.
I'm not a 100% fan of JSX, but I'm certain it will be cleaner than what's being used currently. When I get the time I'll publish a preact branch to demonstrate, I think it will be better to show rather than tell. :) |
Sounds Great, I think I misunderstood you then, looking forward to checking your new branch out. Happy to help and contribute as well. thanks. |
@mhadaily Do you mind to share your Angular Module for iro.js? I like to try it in my Ionic app. |
Hi, sorry that it's been so long! Driving lessons/job searching/etc have taken up a lot of my time recently. The Preact rewrite I was talking about earlier is mostly feature-complete now.I'm pretty happy with this direction, the UI code in particular is a lot clearer, plus it's now already possible to add third-party UI components and customise these components individually. You can see the code here: https://github.com/jaames/iro.js/tree/v4/src There will be some small breaking changes to the API, mostly related to how the components fit themselves into the width/height dimensions provided when creating a new color picker. However these changes mean that it will be trivial to add commonly requested features such as the transparency slider or the option to have no sliders at all. Let me know what you think! |
Another update since the last couple of days have been really productive! iro.js 4.0 is super close to being production-ready, and a bunch of commonly-requested features are already implemented, or very close:
Next I need to rewrite the readme to make it easier to find information, and then I'm going to tackle updating documentation. If anyone is willing to help test the new version please let me know! I'm also looking for ideas for more examples/demos of what can be done with the library. :> |
I finally made the last few changes and released v4! Thank you everyone who contributed your opinions! |
This thread is for discussion about future additions and changes to iro.js, starting with the next major version (4.0.0) and beyond.
So far, the feedback I've received has been overwhelmingly positive (thank you!!), but I've also noticed a need for the library to evolve into something more featureful and customisable.
When I started working on this project I tried to keep it as minimal as possible, one thing that's still really important to me is finding the right balance between having a low-friction, easy to comprehend API, and having enough features for it to be useful in different situations. Hence why I'd like to take some time to consider new additions and how they can be accommodated.
I've compiled an overview of the various features and changes I'd like to see:
Overall goals:
ColorPicker API changes:
mount
,unmount
,reset
marker
param withhandle
anticlockwise
param and make it true by defaultlayout
param, which can be used for more advanced layout and custom UI elements:Code improvements:
marker
->handle
,opts
->params
internallyuse
Side projects:
I should also note that development is going to be slow down for a bit, right now I'm trying to focus on other projects so I have a few extra portfolio pieces -- I'd like to get an internship soon :P
The text was updated successfully, but these errors were encountered: