Skip to content
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

React Images v1 🎉 #199

Closed
5 of 7 tasks
jossmac opened this issue Jan 27, 2018 · 35 comments
Closed
5 of 7 tasks

React Images v1 🎉 #199

jossmac opened this issue Jan 27, 2018 · 35 comments
Labels

Comments

@jossmac
Copy link
Owner

jossmac commented Jan 27, 2018

For the past few months I've been rewriting react-images from the ground up. Having solidified some of the core concepts, i'd really like to hear your thoughts 🙂

Check out the v1 branch -->

The main impetus for rewriting this library was providing consumers with the building blocks necessary to create their component. Need extra buttons in the header? No problem, import react-images' <Header /> component and enhance it. Need to render videos rather than images? No problem, replace the <View /> component and pass the data required to the views property.

General notes:

  • At the moment the v1 branch is just a create-react-app until we decide on a build setup
  • Much of the state is now internal, simplifying implementation for the consumer
  • This project now leverages the amazing react-view-pager, which takes care of the touch/swipe boilerplate via react-motion
  • A great deal of the component architecture has come from recent R&D with @JedWatson for version two of react-select

Features of v1:

  • 🛠   Comprehensively typed (flow)
  • 📱   Support for touch devices
  • 📺   Fullscreen support on desktop devices
  • 🖼   Carousel without modal dialog
  • 🏖   No restrictions on data shape
  • 🚀   Replaceable component architecture

Many of the requirements, issues, and feature requests should be addressed by the new customisable component architecture without requiring changes to the core.

What this means for v0.x

No need to worry. I, together with @neptunian (the primary maintainer, who's doing an amazing job!), will continue to release critical bug fixes. We won't however be implementing enhancements or new features unless provided in a rock-solid PR.

The new API is a massive departure from v0.x, so there won't be an "upgrade guide" as such. I'll endeavour to provide a handful of examples to cover most use-cases and welcome anyone else to do the same.

Still left to do:

  • settle on and implement a build tool
  • unit tests for each component
  • integration tests for carousel/modal
  • lockdown the API and release an alpha
  • light-weight theming/styling for components
  • add classnames for those who prefer styling with CSS
  • default components implement ARIA best practices

I'd like to thank everyone who has contributed to this project over the years, without your support react-images wouldn't be where it is today. Cheers to the open source community 💖

Looking forward to your feedback!

@jossmac jossmac added the v1 label Jan 27, 2018
@jorrit
Copy link
Contributor

jorrit commented Jan 28, 2018

Congrats! Which build systems have you considered so far.

@jossmac
Copy link
Owner Author

jossmac commented Jan 28, 2018

Thanks!

We'll likely port the build system from React Select, which uses Rollup.

NB: Parcel looks promising but may not yet be mature.

@jorrit
Copy link
Contributor

jorrit commented Feb 12, 2018

It would benefit testing if v1 could be published to npm with a beta or alpha version number and the next tag. See https://docs.npmjs.com/getting-started/using-tags.

@codeluggage
Copy link

@jossmac Is there a way we can help test this? What is the recommended way to use the v1 branch instead of the npm package, as it stands today?

Super excited about this! 🎉

@jossmac
Copy link
Owner Author

jossmac commented Feb 18, 2018

Update

Checkout the demo site: v1 Demo -->

Alpha releases of react-images@1.0.0-alpha.x available on npm:

yarn add react-images@next

CC @jorrit @codeluggage

@benhowell
Copy link
Contributor

benhowell commented Feb 18, 2018 via email

@benhowell
Copy link
Contributor

benhowell commented Feb 18, 2018 via email

@benhowell
Copy link
Contributor

benhowell commented Feb 18, 2018 via email

@jossmac
Copy link
Owner Author

jossmac commented Feb 19, 2018

@benhowell cheers mate, fixed now! glam and flex weren't playing nice.

Also added prop type documentation 💃

This was referenced Feb 20, 2018
@michalica
Copy link

michalica commented Apr 16, 2018

Wha about this?
const images = [{ src: 'path/to/image-1.jpg', src: 'path/to/image-2.jpg' }];

You define array of images in doc in this way. You duplicate key.

@neptunian
Copy link
Collaborator

@codeluggage @damienbrz @weslleyaraujo the files should be on NPM now

@kachkaev
Copy link
Contributor

@neptunian should the version be 1.0.0-alpha.2 instead of 1.0.1-alpha.1? 🤔

@neptunian
Copy link
Collaborator

@kachkaev you're right, i'll fix that

@kripod
Copy link
Contributor

kripod commented Jul 27, 2018

@neptunian Unfortunately, the lib folder is still not published in 1.0.0-alpha.2.

@ArVan
Copy link

ArVan commented Aug 20, 2018

@neptunian just installed the alpha version and the lib folder is not there.

@neptunian
Copy link
Collaborator

@ArVan @kripod please use yarn add react-images@next

@raRaRa
Copy link

raRaRa commented Sep 25, 2018

I get the following warnings when adding react-images@next:

warning "react-images > react-scrolllock@1.0.9" has incorrect peer dependency "react@^0.14 || ^15.0".
warning "react-images > react-view-pager@0.6.0" has unmet peer dependency "prop-types@^15.5.8".

Have these packages been upgraded recently?

@janklimo
Copy link

1.0.0-alpha.3 working great for me 👍

@kripod
Copy link
Contributor

kripod commented Dec 2, 2018

Unfortunately, SSR is still not working (see #247 for further details).

@sergonius
Copy link

sergonius commented Dec 3, 2018

Ran into the SSR issue with Netlify as well.
The stable version has a nice little canUseDom.

Edit: In the meantime, I just used patch-package to add a few checks in ModalGateway. This seems to work and builds fine, there might be corner cases I am not aware of, though.

Here are the file patch contents:

patch-package
--- a/node_modules/react-images/dist/react-images.es.js
+++ b/node_modules/react-images/dist/react-images.es.js
@@ -1634,6 +1634,7 @@ var ModalGateway = function (_Component) {
           target = _props.target,
           children = _props.children;
 
+      if (!target) return null;
 
       return createPortal(React.createElement(TransitionGroup, { component: FirstChild, children: children }), target);
     }
@@ -1642,7 +1643,7 @@ var ModalGateway = function (_Component) {
 }(Component);
 
 ModalGateway.defaultProps = {
-  target: document.body
+  target: typeof window !== 'undefined' ? document.body : null,
 };
 
 export { ModalGateway, Modal, carouselComponents, modalComponents };

@OriAmir
Copy link

OriAmir commented Jan 21, 2019

@jossmac @neptunian what about version 1?there is some plan to release that? it's still 0.5.19 .
still not exist 'swipe' option on mobile on my 'LightBox' , there is some plan for that also ?

tnx!

@OriAmir
Copy link

OriAmir commented Jan 30, 2019

@jossmac @neptunian
it's looks like this library will not get support anymore ? no one answer here or on issues...

@neptunian
Copy link
Collaborator

unless there are any major issues with v1 i'd be happy to release it if @jossmac is okay with it. I'm not sure Flow was the best decision over Typescript for typing but, perhaps that could be changed later. What does everyone think? The only major issue that anyone seems to have brought up is the SSR issue which looks like an easy fix.

@iammatthias
Copy link

@jossmac @neptunian Will the SSR issue be fixed any time soon? It would be great if v1 could be released with SSR support.

@OriAmir
Copy link

OriAmir commented Feb 2, 2019

@jossmac @neptunian Will the SSR issue be fixed any time soon? It would be great if v1 could be released with SSR support.

@iammatthias
I think that right now no one work on this library and the best option is to release v1 and then add improvements .

@Maxhou00
Copy link

Maxhou00 commented Feb 4, 2019

Is there any plan to released this version ? I feel like nobody is taking care of this library anymore.

@OriAmir
Copy link

OriAmir commented Feb 4, 2019

Is there any plan to released this version ? I feel like nobody is taking care of this library anymore.

You right, no one cares about this library.
@jossmac @neptunian If you don't want to support it anymore so give the keys to someone else that want to do that, I maybe can help and I think and also another people can help with that.

@neptunian
Copy link
Collaborator

@OriAmir There hasn't exactly been any PRs to fix any issues with this so it wouldn't make much of a difference. If someone would like make a PR for the SSR issue, that would be welcome. Otherwise I'll have to get it to when I get a chance which should be soonish!

@OriAmir
Copy link

OriAmir commented Feb 6, 2019

@OriAmir There hasn't exactly been any PRs to fix any issues with this so it wouldn't make much of a difference. If someone would like make a PR for the SSR issue, that would be welcome. Otherwise I'll have to get it to when I get a chance which should be soonish!

@neptunian
I think that the best option is firstly to release v1 and then fix the SSR and other issues because the library needs some refresh -there are many issues without replay and any new release not happened in the last 6 months.

@iammatthias
Copy link

@OriAmir the SSR issue affects a lot of people who might use this library, considering how popular frameworks like Gatsby are becoming.

If you want the current version released as a V1, what’s stopping you from using the alpha? Changing it from alpha to V1 doesn’t make any functional difference.

Give the maintainers time to do their thing and live their lives. The great thing about this project being open-source is that nothing is stopping you from submitting a PR that fixes what you perceive to be an issue.

@neptunian, thanks for the work you’ve put into this.

@neptunian
Copy link
Collaborator

neptunian commented Mar 23, 2019

if you install the latest next version (react-images@next), the SSR issue should be fixed. let me know if there are any issues and then we can see about finally moving to v1!

@neptunian
Copy link
Collaborator

I want to mention before the release of v1 that I do not plan to maintain v0.x. I can create a branch for it, if anyone else wants to work on it, and accept PRs there.

@daydream05
Copy link

@neptunian Thank you for the amazing work! And everyone here as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests