Production Ready?
Thanks a lot for the library!
I wanted to clarify a few things:
- Is it safe to use in a real project?
- Should I use master branch or v1.0 branch
- Does it support React Native
- Do you need help?
Hey @almeynman,
thanks for your interest in adonis! Unfortunately, adonis is not production ready yet. We're currently using the v1.0 branch in the new version of PhotoEditorSDK, which is also still under development. The v1.0 branch is already pretty bullet-proof, but still not finished. There's just a few things missing in v1.0:
Extension of base styles, e.g.:
const A = adonis.css({
background: 'red'
})
const B = adonis(A).css({
color: 'white'
})
A smarter way of generating selector hashes
Right now, all properties except dynamic properties are taken into account for hash generation. So there's a problem with something like this:
const A = adonis.div({
color: theme => theme.textColor
})
const B = adonis.div({
color: theme => theme.otherTextColor
})
The selectors for these two components will exactly be the same, even though the actual color value differs. I've thought about some mustache-like syntax, such as:
const A = adonis.div({
color: '{{textColor}}'
})
Adonis would automatically replace the {{textColor}} with theme.textColor, but it would take {{textColor}} for hash generation.
React Native support
I've never worked with React Native, so I don't know what it takes to support it. Maybe you can help out here :)
Thanks @saschagehlich for a quick reply!
React Native
Regarding React Native support we can take styled components approach and move everything React Native related to 'adonis/native'. I will be happy to help you with that
Theming
Regarding theming, I currently use react-with-styles. So for me, it would be nice to have a seamless integration with react-with-styles. otherwise, I will need to change the setup in several projects.
Regarding your issue with selector hashes. Based on my humble knowledge of JS and of your problem and because the function is not really dynamic (only used for theming) I think you can get a return value of a function and use it for hashing purposes. I can't find any better advice than this, sorry...
There are also interesting features that can be added to a roadmap, all inspired by this blog post:
- child selectors (probably aphrodite's concern)
- grid support