You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 20, 2021. It is now read-only.
This article introduces a software development paradigm, which has been implemented and used on Verizon Media Group's Video syndication teams for the past 3 years.
3
+
This article introduces a software development paradigm, which has been implemented and used on Verizon Media Group's Video syndication teams for the past 3 years.
4
4
5
-
The 'Branch versions' concept allows stakeholders to test and verify different code variants without affecting production.
5
+
_Branch versions_ allow stakeholders to test and verify different code variants without affecting production.
6
6
7
7
On our teams, every code change, creates a branch version which allows product managers, QA teams and different customers to test and verify changes, without merging it to master.
8
8
@@ -14,35 +14,37 @@ Serving a branch version to a group of users with a POC can contribute ideas for
14
14
2. A bug is reported - use branch versions to inspect, and before deploying the fix, assign the branch version to a user/PM/QA to verify the fix.
15
15
Only then, you update your tests, submit a PR and merge to master.
16
16
17
-
3. Easy rollback - A critical bug was deployed, requiring a fast rollback. Now, thanks to branch versions, we're storing every version created by every branch, including master branch, which allows you to easily transition all of your users to a specific version in a matter of seconds.
17
+
3. Easy rollback - A critical bug was deployed, requiring a fast rollback. Now, thanks to branch versions, we're storing every version created by every branch, including master branch, which allows you to easily transition all of your users to a specific version in a matter of seconds.
18
18
19
19
(TBH - Scenario 3 never happened. avg. 90% unit tests coverage and branch versions)
20
20
21
-
So, what defines a branch version?
21
+
## So, what defines a branch version?
22
22
23
23
1. Isolation - The modified code is not part of master branch.
24
24
2. Debug - Branch versions contain sourcemaps, debug info developers can inspect the code on multiple environments(extremely useful for cross-browser issues)
25
25
3. Protected - A branch version can be used only by specific people. (recommended)
26
26
27
27
The core concept is that a branch version simply represents a different deployment path.
The key concepts we use in webpack are the following features:
36
36
37
37
1.[dynamic imports](https://webpack.js.org/guides/code-splitting/#dynamic-imports) - each webpack entry point dynamically imports the rest of the bundle. ([js](https://github.com/eranshapira/webpack-branch-versions/blob/master/src/index.js) dynamically loads [js](https://github.com/eranshapira/webpack-branch-versions/blob/master/src/app.js))
38
38
2.[output.publicPath](https://webpack.js.org/configuration/output/#outputpublicpath) - define an absolute path for bundles, which instructs webpack to load any asset without any relative path issues.
39
39
40
-
CI/CD
40
+
### CI/CD
41
41
42
-
There is only one concept that we need to maintain in our CI/CD process - Deployment must be performed to the same path specified in webpack's config.output.publicPath.
42
+
There is only one concept that we need to maintain in our CI/CD process - Deployment must be performed to the same path specified in webpack's config.output.publicPath.
43
43
44
-
Server endpoint
44
+
### Backend
45
45
46
46
Now that we have an infrastructure to deploy different branch versions, we need to provide a way to use these versions.
47
47
48
48
Examine [this very-basic-never-to-be-used server](https://github.com/eranshapira/webpack-branch-versions/blob/master/server/index.js), In our code, the html served in the response is changing the folder from which it loads main.js.
0 commit comments