Frontend environment setup-code development, testing, and deployment

Source: Internet
Author: User

I have been working on the frontend for a while and I want to take notes.

The purpose of building a series of front-end environments is to take the front-end team as a whole. The first part is the development environment for effective team-based collaborative development.

1.CodeVersion Management

SVN is essential. The version number is planned to be deployed based on the three-digit version of the project and four-digit version development. For example, if I want to build project a with the version 1.0.0, the first code version I submitted for testing is 1.0.0.1. Each four-digit version is differentiated by TAG. QA deploys the test code according to the tag, and OP deploys the online code.

If multiple projects are developed at the same time, branch is enabled. These require a project management platform to manage versions.

2. Development Environment

I suppose the front-end team is in the scope of V and C in HTML CSS JS MVC. The best environment is a development environment for everyone. The code is synchronized to other people's code through SVN. However, all file paths are consistent.

For example

Img.xx.com/css of CSS

Img.xx.com/js of JS

Flash img.xx.com/swf

In the background environment, assume that each backend development has an independent environment. If you call the code with someone else, let him point the configuration to your v c directory for debugging.

Debug issues in the QA environment. Your Environment and QA Environment Code are deployed in the same way. You can use the host to switch static files, such as css js flash. After all, most of the front-end problems are front-end code problems. V and C problems are debugged in their own environments, and static resources are switched to the QA host.

Data problems. Finally, there is a big data creation platform that uses a common database to provide interfaces for data addition and modification. This is an ideal status. Of course, this platform will be very troublesome, if this is not the case, you can use the backend data operation interface to operate the data.

3. compiling environment

The hateful front-end code is bare, which has many problems, most of which are performance problems and some are cache problems.

Therefore, it is necessary to provide a compilation environment. The compilation process is safe before testing, because it will undergo QA quality testing. If it is troublesome in the op stage, no one tests the code compilation bug.

Compilation of General Solutions

1. Batch operations, such as version numbers

2. Code merging and Compression

3. code optimization or function replacement, such as resource Packaging

I have never been optimistic about development. So how complicated it is to try it on your own.

Generally, there is a public development environment, where one machine is a host, no matter where the main branches are put, there is a lot of confusion, there is no version management software at the front end, manual maintenance of multiple concurrent versions.

There may also be version management. There are still one developer in the development environment, and there is no host. Static resources are introduced through the template conf management path. This code is not conducive to resource path management, especially for images. The full path is required for adding PNG translucent files. It is best to combine multiple CSS files with the root directory path.

This article ends with all kinds of tragedies. The following describes the development mode and modularization.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.