@samitouri / QOS-React-2 / commits / 3527d9d91c

Establish a convention for forcing jsx rebuilds.

Pull request #526 updated the behavior of vendor/constants.js without changing any source files or the bin/jsx-internal script, so files that should have been rebuilt (like utils/__tests__/ImmutableObject-test.js) were not automatically rebuilt (unless you knew to do `grunt clean` or `rm -rf .module-cache` manually). This commit allows us to bump a version number when we know the transform toolchain has been altered in a way that will not be visible to commoner/jsx. With this convention, if we reset to an older revision (e.g. during a git bisect) and the appropriate cached module files are still in the .module-cache/, they can be used without rebuilding. That's why I prefer this approach to just deleting the .module-cache/. Closes #104. Closes #496. Closes #530.

Ben Newman committed Nov 13, 2013 at 18:02 UTC 3527d9d91c52362d786784e02414ba8a7d9f0e24
2 files changed +7 -1
grunt/config/jsx/jsx.js
+3
@@ -10,6 +10,7 @@ var rootIDs = [
10 var getDebugConfig = function() {
11 return {
12 "debug": true,
13 + "jsxConfig": grunt.config.data.pkg.jsxConfig,
14 "constants": {
15 "__VERSION__": grunt.config.data.pkg.version,
16 "__DEV__": true
@@ -33,6 +34,7 @@ var test = {
34 return {
35 "debug": true,
36 "mocking": true,
37 + "jsxConfig": grunt.config.data.pkg.jsxConfig,
38 "constants": {
39 "__VERSION__": grunt.config.data.pkg.version,
40 "__DEV__": true
@@ -49,6 +51,7 @@ var release = {
51 getConfig: function() {
52 return {
53 "debug": false,
54 + "jsxConfig": grunt.config.data.pkg.jsxConfig,
55 "constants": {
56 "__VERSION__": grunt.config.data.pkg.version,
57 "__DEV__": false
package.json
+4 -1
@@ -64,5 +64,8 @@
64 "engines": {
65 "node": ">=0.10.0"
66 },
67 - "preferGlobal": true
67 + "preferGlobal": true,
68 + "jsxConfig": {
69 + "version": 1
70 + }
71 }