forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request facebook#5381 from kevinrobinson/react-dom-server-…
…package Add additional secret property to build artifact for react-dom-server
- Loading branch information
Showing
6 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ examples/ | |
build/ | ||
scripts/bench/bench-*.js | ||
vendor/react-dom.js | ||
vendor/react-dom-server.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'use strict'; | ||
|
||
var grunt = require('grunt'); | ||
var UglifyJS = require('uglify-js'); | ||
|
||
var LICENSE_TEMPLATE = | ||
grunt.file.read('./grunt/data/header-template-extended.txt'); | ||
|
||
module.exports = function() { | ||
var templateData = { | ||
package: 'ReactDOMServer', | ||
version: grunt.config.data.pkg.version, | ||
}; | ||
var header = grunt.template.process( | ||
LICENSE_TEMPLATE, | ||
{data: templateData} | ||
); | ||
var src = grunt.file.read('vendor/react-dom-server.js'); | ||
grunt.file.write( | ||
'build/react-dom-server.js', | ||
header + src | ||
); | ||
grunt.file.write( | ||
'build/react-dom-server.min.js', | ||
header + UglifyJS.minify(src, {fromString: true}).code | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Based off https://github.com/ForbesLindesay/umd/blob/master/template.js | ||
;(function(f) { | ||
// CommonJS | ||
if (typeof exports === "object" && typeof module !== "undefined") { | ||
module.exports = f(require('react')); | ||
|
||
// RequireJS | ||
} else if (typeof define === "function" && define.amd) { | ||
define(['react'], f); | ||
|
||
// <script> | ||
} else { | ||
var g | ||
if (typeof window !== "undefined") { | ||
g = window; | ||
} else if (typeof global !== "undefined") { | ||
g = global; | ||
} else if (typeof self !== "undefined") { | ||
g = self; | ||
} else { | ||
// works providing we're not in "use strict"; | ||
// needed for Java 8 Nashorn | ||
// see https://github.com/facebook/react/issues/3037 | ||
g = this; | ||
} | ||
g.ReactDOM = f(g.React); | ||
} | ||
|
||
})(function(React) { | ||
return React.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
}); |