|
| 1 | +# MAINTENANCE |
| 2 | + |
| 3 | +Three.js constantly evolves which means these articles will be **out of date* |
| 4 | +if not constantly maintained. Leaving up out of date articles is irresponsible |
| 5 | +because users will come to the site and get bad info that will confuse and |
| 6 | +frustrate them. Keeping the articles up to date with the latest release of |
| 7 | +three.js is therefore very important. |
| 8 | + |
| 9 | +### Upgrading three.js to the latest version |
| 10 | + |
| 11 | +Clone `three.js` using git in a folder above wherever you checked out threejsfundamentals. |
| 12 | + |
| 13 | +In other words if we were starting from scratch |
| 14 | + |
| 15 | +```bash |
| 16 | +git clone https://github.com/gfxfundamentals/threejsfundamentals.git |
| 17 | +git clone https://github.com/mrdoob/three.js.git |
| 18 | +``` |
| 19 | + |
| 20 | +Then checkout the latest release in three.js. Next, run `npm run bumpthree`. |
| 21 | + |
| 22 | +```bash |
| 23 | +# assuming you are in the threejsfundamentals folder |
| 24 | +cd .. |
| 25 | +cd three.js |
| 26 | +git fetch origin master |
| 27 | +git checkout r132 # the release you want |
| 28 | +cd ../threejsfundamentals |
| 29 | +npm run bumpthree |
| 30 | +``` |
| 31 | + |
| 32 | +This will copy the relevant files from three.js to |
| 33 | +`threejs/resources/threejs/<release>` and attempt to update |
| 34 | +all references in the articles and examples to point to the |
| 35 | +new release. |
| 36 | + |
| 37 | +After that, check the [migration guide](https://github.com/mrdoob/three.js/wiki/Migration-Guide) |
| 38 | +for the things that need to be changed. |
| 39 | + |
| 40 | +### Examples of things that were changed or need to be changed |
| 41 | + |
| 42 | +* The article on `Geometry` had to be removed and the article on `BufferGeometry` updated because |
| 43 | + `Geometry` was removed. Sadly it was a nice example of building a heightmap but I didn't have |
| 44 | + time to re-write it as a different article. |
| 45 | + |
| 46 | +* The 3D LUT article should be deleted as there is now an official 3D LUT solution in the three.js examples |
| 47 | + |
| 48 | +* The article on how to fix the bugs in the WebGL Globe by using morph targets needs to be fixed |
| 49 | + as how morph targets work has changed |
| 50 | + |
| 51 | +* rAF loops should be changed to `Renderer.setAnimationLoop` |
| 52 | + |
| 53 | +* `TextGeometry` needs to be removed or changed in the primitives article as is no longer part of core three.js |
| 54 | + |
| 55 | +* `ParametricGeometry` needs to be removed or changed in the primitives article as is no longer part of core three.js |
| 56 | + |
| 57 | +* lots of minor changes, for example function names changing, functions getting deprecated, parameters changing, |
| 58 | + default values changing and breaking things, import statements changing, etc... |
| 59 | + |
| 60 | +* project organization changing (the npm version of changed making it no longer useful for this project) |
| 61 | + |
| 62 | + |
0 commit comments