Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the proper 'workflow' of modern React.js development? [closed]

Let's assume that I am a decent JS programmer. I can easily do React.js development. I also can write HTML and CSS to some extent. I cannot, however, build a webpage from the ground up, i.e. define the HTML structure (say in terms of React components or just plain HTML), add some CSS and get the all-shiny responsive modern-looking fancy webpage. So, I work with a designer, who uses some sort of black magic (or maybe a WYSIWYG tool, or a service like wix.com) to prototype a web page.

So, what I get is a bunch of html files, images, css styles and maybe a bit of javascript.

Now I need to convert all this into a component hierarchy of React. I'm sure I can do this, and after the job is done, I get a shiny new website, beautiful from the technological and aesthetical point of view. However, we all know that we work in Agile environments. Later on, a designer wants me to change something. 'Add a black border' he says. And here things go out of control. Should I do this (manually look up the style in css and add a border)? What if changes required are more complicated? Like swap a header and a footer? Should he do this? (regenerate those source htmls/css/images again) What happens after that? Should I diff the whole website to learn what have changed and reimplement the whole component structure to reflect changes? Are there any accepted methodologies to solve this evil circle? Maybe a tool that maps the input ugly html code to the properly done React code? Or maybe I am totally wrong and I should learn the art of design myself?

Edit: Ok, as everybody is misundestanding the question, here is the shorter version. If the Templater changes the templates already implemented in React site, what can I do except manually diff and patch all the changes to the source css/html files?

like image 628
Hedin Avatar asked Apr 16 '17 06:04

Hedin


People also ask

What is the workflow of ReactJS?

React is an excellent library for creating component-based user interfaces. It takes care of the developer experience by providing declarative APIs for creating components. The React ecosystem has an excellent global package called create-react-app that can easily set up a React project with a single command.

How do you create a workflow in ReactJS?

Once above steps are done then let's create react app. npm install -g create-react-app => It install a global configuration for react which can build a commonly used workflow for single page app. create-react-app my-app => With this command it creates a project with name my-app with all common build workflow.

Which kind of code do you write when using ReactJS?

React uses an HTML-in-JavaScript syntax called JSX (JavaScript and XML). Familiarity with both HTML and JavaScript will help you to learn JSX, and better identify whether bugs in your application are related to JavaScript or to the more specific domain of React.


1 Answers

What you're sounds a bit sketchy to me. You have to know CSS and HTML if you want to build a website, and especially maintain it. The designer probably won't be here forever for you and you would end-up in a difficult position.

The kind of flow you describe, where the designers creates all the structure and gives you the full html and css code was only working in the age of jQuery. The plug of your scripts were pretty easy and didn't required much changes, since it was decoupled from the actual html and you would use dom ids for the targeting.

How it works at Uber, but I'm sure in a lot of other companies, is that the designer is in charge of the design, but that's it, the rest is up to you. You have to make a second pass after him for the actual implementation.

Since reproduction can be pretty difficult and approximative, you can use Invision, where the designer will create the mockups, but you as a developer can get all the css properties of an element, making the integration much easier to do (dunno if wix has the same kind of feature).

If your designer updates a part of the design, it becomes straight-forward for you to know what changed and what component needs to be updated. That's one of the benefits of owning the code rather than taking one from someone else (especially if it was automatically generated).

like image 170
Preview Avatar answered Oct 15 '22 19:10

Preview