liferay / liferay-frontend-projects

A monorepo containing assorted Frontend Infrastructure Team projects
Other
69 stars 68 forks source link

Add react-dropzone #324

Closed boton closed 2 years ago

boton commented 4 years ago

What is your proposal?

Add react-dropzone library to the portal. Repo: https://github.com/react-dropzone/react-dropzone Docs: https://react-dropzone.js.org

We try to plan a new uploader and remove the AUI old one, maybe this helps.

Why would adopting this proposal be beneficial?

This component adds the logic of d&d files.

What are the alternatives to this proposal?

Making our own component.

julien commented 4 years ago

Hey @boton

As you might know we already have react-dnd in liferay-portal.

If I'm not mistaken the Page Editor (echo) team already has a dropzone component and I'm sure they'd be very happy helping you out.

julien commented 4 years ago

/cc @victorg1991 @p2kmgcl @sandrodw3 @veroglez

victorg1991 commented 4 years ago

Hey @julien Our dropzone shares the name with this, but it is a totally different thing. it seems that react-dropzone takes care of a bunch of things related to files being dropped, our dropzone is only related to fragments

wincent commented 4 years ago

We should probably include a link to bundlephobia on issues like these to help us get a feel for the size of the dependency graph.

julien commented 4 years ago

@victorg1991 yes I know, but I still think it could be used as an example instead of adding yet another dependency

bryceosterhaus commented 4 years ago

I mentioned this as potential idea for Clay as well. Perhaps the lexicon team would want to establish a common pattern for this and we could provide a clay component built with react-dnd.

boton commented 4 years ago

What do you think @emiliano-cicero @jbalsas @drakonux @victorvalle?

drakonux commented 4 years ago

Hey guys! I'm a bit lost. All the dropzones in Portal should follow the tips of Drag and Drop pattern (but Portal Designers can differ from the definition made) :

About files. Lexicon has a design specifically for Portal for File Uploader made by @emiliano-cicero :

@bryceosterhaus we want! we always want more consistency in Portal. Sadly, we can't proactively decide if this is important. So @boton keep in mind what implications have if a Product Team requests help from the infra-team (design or front).

Said this:

I encourage you and your team @boton to send a complete proposal and Lexicon will review it.

wincent commented 4 years ago

Just to mirror here some offline discussion I had with @ambrinchaudhary about this, here are my 2 cents:

bryceosterhaus commented 4 years ago

@wincent I was thinking about something similar over the weekend specifically in relation to Clay. One approach that I think we can add to help avoid the two extremes would be to have the Clay team actively create demos and examples that people need. For example, I am thinking this would mean that someone creates a GH issue on clay like "How to add a dropzone" and then we can publish a new demo storybook with our suggested implementation.Or we can also respond with codesandbox example as well if that is easier. This issue gave me this idea since it is likely better for us to show an example implementation of how we would hypothetically add it to Clay, without having to commit to publishing it quite yet. This should up speed up delivery and also give teams some autonomy.

Long term the goal would be to see patterns that other teams need and then for the Clay team to implement commonly used components. This ultimately helps us reduce chaos because we know how people are implementing features and should be easier for us to swap out in the future.

If the component is very time sensitive, we can push them to create their own implementation that we can go back and adjust later. Obviously this leans more to the "chaos" side, but I think it should be rare that something is truly that urgent.

bryceosterhaus commented 2 years ago

We've centralized more or less on react-dnd as the "go to" dependency for all drag and drop related solutions.

Closing this issue as we don't plan on adding react-dropzone as a top-level dependency