-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
550 additions
and
446 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
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,60 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
pushd `dirname "${BASH_SOURCE[0]}"` > /dev/null | ||
source "./config.sh" | ||
|
||
cd "$ROOT" | ||
|
||
if [[ -z "${SKIP_DCE_COMPILATION}" ]]; then | ||
./scripts/compile-dead-code.sh "$@" | ||
fi | ||
|
||
cd "$DCE_CACHE_DIR" | ||
|
||
NO_DEBUG_MAX_SIZE=6000 | ||
NO_REQUIRE_MAX_SIZE=6000 | ||
|
||
BUILD_WITH_DEBUG="$DCE_CACHE_DIR/with-debug.js" | ||
BUILD_NO_DEBUG="$DCE_CACHE_DIR/no-debug.js" | ||
BUILD_NO_MENTION="$DCE_CACHE_DIR/no-mention.js" | ||
BUILD_NO_REQUIRE="$DCE_CACHE_DIR/no-require.js" | ||
BUILD_NO_SOURCES="$DCE_CACHE_DIR/no-sources.js" | ||
|
||
WITH_DEBUG_SIZE=$(stat -f %z "$BUILD_WITH_DEBUG") | ||
NO_DEBUG_SIZE=$(stat -f %z "$BUILD_NO_DEBUG") | ||
NO_MENTION_SIZE=$(stat -f %z "$BUILD_NO_MENTION") | ||
NO_REQUIRE_SIZE=$(stat -f %z "$BUILD_NO_REQUIRE") | ||
NO_SOURCES_SIZE=$(stat -f %z "$BUILD_NO_SOURCES") | ||
|
||
echo | ||
echo "stats:" | ||
echo "WITH_DEBUG: $WITH_DEBUG_SIZE bytes" | ||
echo "NO_DEBUG: $NO_DEBUG_SIZE bytes" | ||
echo "NO_MENTION: $NO_MENTION_SIZE bytes" | ||
echo "NO_REQUIRE: $NO_REQUIRE_SIZE bytes" | ||
echo "NO_SOURCES: $NO_SOURCES_SIZE bytes" | ||
echo | ||
|
||
if [[ "$NO_DEBUG_SIZE" != "$NO_MENTION_SIZE" ]]; then | ||
echo "failure: NO_DEBUG and NO_MENTION expected to have the same size." | ||
exit 1 | ||
fi | ||
|
||
if [[ "$NO_REQUIRE_SIZE" != "$NO_SOURCES_SIZE" ]]; then | ||
echo "failure: NO_REQUIRE and NO_SOURCES expected to have the same size." | ||
exit 2 | ||
fi | ||
|
||
if [[ "$NO_DEBUG_SIZE" -gt "$NO_DEBUG_MAX_SIZE" ]]; then | ||
echo "failure: NO_DEBUG expected to have size smaller than $NO_DEBUG_MAX_SIZE bytes." | ||
exit 3 | ||
fi | ||
|
||
if [[ "$NO_REQUIRE_SIZE" -gt "$NO_REQUIRE_MAX_SIZE" ]]; then | ||
echo "failure: NO_REQUIRE_SIZE expected to have size smaller than $NO_REQUIRE_MAX_SIZE bytes." | ||
exit 4 | ||
fi | ||
|
||
popd |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,25 @@ | ||
(ns devtools.optional | ||
(:require [cljs.pprint] | ||
[cljs.stacktrace])) | ||
|
||
; requires here do not play well with DCE in advanced mode | ||
; see https://github.com/binaryage/cljs-devtools/issues/37 | ||
; | ||
; this file exists to be required dynamically in dev mode only via | ||
; (emit-if-compiler-in-dev-mode (goog/require "devtools.optional")) | ||
; | ||
; we rely on the fact that in :none optimizations mode clojurescript compiler produces all js files | ||
; even if they are not reachable from :main namespace (if specified) | ||
; | ||
; please note that you should manually require namespaces which these requires depend on | ||
; to achieve correct ordering of requires for static code, currently goog.string and clojure.string | ||
|
||
; -- wrappers --------------------------------------------------------------------------------------------------------------- | ||
; | ||
; these are convenience wrappers, cljs.stacktrace/parse-stacktrace is a multi-method, so we couldn't call it directly from js | ||
|
||
(defn pprint [& args] | ||
(apply cljs.pprint/pprint args)) | ||
|
||
(defn parse-stacktrace [& args] | ||
(apply cljs.stacktrace/parse-stacktrace args)) |
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
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