Skip to content

Commit

Permalink
refactor(animations): support browser animation rendering (angular#14578
Browse files Browse the repository at this point in the history
)
  • Loading branch information
matsko authored and IgorMinar committed Feb 22, 2017
1 parent 88755b0 commit 830393d
Show file tree
Hide file tree
Showing 88 changed files with 3,429 additions and 1,225 deletions.
71 changes: 70 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ cd `dirname $0`
PACKAGES=(core
compiler
common
animations
forms
platform-browser
platform-browser-dynamic
http
platform-server
platform-webworker
platform-webworker-dynamic
animation
upgrade
router
compiler-cli
Expand Down Expand Up @@ -161,6 +161,10 @@ do
JS_STATIC_PATH_ES5=${DEST_MODULE}/${PACKAGE}/static.es5.js
JS_UPGRADE_PATH=${DEST_MODULE}/${PACKAGE}/upgrade.js
JS_UPGRADE_PATH_ES5=${DEST_MODULE}/${PACKAGE}/upgrade.es5.js
JS_ANIMATIONS_PATH=${DEST_MODULE}/${PACKAGE}/animations.js
JS_ANIMATIONS_PATH_ES5=${DEST_MODULE}/${PACKAGE}/animations.es5.js
JS_ANIMATIONS_TESTING_PATH=${DEST_MODULE}/${PACKAGE}/animations/testing.js
JS_ANIMATIONS_TESTING_PATH_ES5=${DEST_MODULE}/${PACKAGE}/animations/testing.es5.js

# UMD/ES5
UMD_ES5_PATH=${DEST_BUNDLES}/${PACKAGE}.umd.js
Expand All @@ -170,6 +174,9 @@ do
UMD_ES5_MIN_PATH=${DEST_BUNDLES}/${PACKAGE}.umd.min.js
UMD_STATIC_ES5_MIN_PATH=${DEST_BUNDLES}/${PACKAGE}-static.umd.min.js
UMD_UPGRADE_ES5_MIN_PATH=${DEST_BUNDLES}/${PACKAGE}-upgrade.umd.min.js
UMD_ANIMATIONS_ES5_PATH=${DEST_BUNDLES}/${PACKAGE}-animations.umd.js
UMD_ANIMATIONS_ES5_MIN_PATH=${DEST_BUNDLES}/${PACKAGE}-animations.umd.min.js
UMD_ANIMATIONS_TESTING_ES5_PATH=${DEST_BUNDLES}/${PACKAGE}-animations-testing.umd.js

if [[ ${PACKAGE} != router ]]; then
LICENSE_BANNER=${PWD}/modules/@angular/license-banner.txt
Expand Down Expand Up @@ -218,6 +225,16 @@ do
$TSC -p ${SRCDIR}/tsconfig-testing.json
fi

if [[ -e ${SRCDIR}/tsconfig-animations.json ]]; then
echo "====== [${PACKAGE}]: COMPILING (ANIMATIONS): ${TSC} -p ${SRCDIR}/tsconfig-animations.json"
$TSC -p ${SRCDIR}/tsconfig-animations.json

if [[ -e ${SRCDIR}/tsconfig-animations-testing.json ]]; then
echo "====== [${PACKAGE}]: COMPILING (ANIMATION TESTING): ${TSC} -p ${SRCDIR}/tsconfig-animations-testing.json"
$TSC -p ${SRCDIR}/tsconfig-animations-testing.json
fi
fi

if [[ -e ${SRCDIR}/tsconfig-static.json ]]; then
echo "====== [${PACKAGE}]: COMPILING (STATIC): ${TSC} -p ${SRCDIR}/tsconfig-static.json"
$TSC -p ${SRCDIR}/tsconfig-static.json
Expand Down Expand Up @@ -357,6 +374,58 @@ do
mv ${UMD_UPGRADE_ES5_PATH}.tmp ${UMD_UPGRADE_ES5_PATH}
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_UPGRADE_ES5_MIN_PATH} ${UMD_UPGRADE_ES5_PATH}
fi

if [[ -d animations ]]; then
echo "====== Rollup ${PACKAGE} animations"
../../../node_modules/.bin/rollup -i ${DESTDIR}/animations/index.js -o ${DESTDIR}/animations.tmp.js

echo "====== Downleveling ${PACKAGE} ANIMATIONS to ES5/UMD"
[[ -e ${SRCDIR}/.babelrc-animations ]] && cp ${SRCDIR}/.babelrc-animations ${DESTDIR}/.babelrc
$BABELJS ${DESTDIR}/animations.tmp.js -o ${UMD_ANIMATIONS_ES5_PATH}
rm -f ${DESTDIR}/.babelrc

echo "====== Move ${PACKAGE} animations typings"
rsync -a --exclude=*.js --exclude=*.js.map ${DESTDIR}/animations/ ${DESTDIR}/typings/animations
mv ${DESTDIR}/typings/animations/index.d.ts ${DESTDIR}/typings/animations/animations.d.ts
mv ${DESTDIR}/typings/animations/index.metadata.json ${DESTDIR}/typings/animations/animations.metadata.json

echo "====== Rollup ${PACKAGE} animations/testing"
../../../node_modules/.bin/rollup -i ${DESTDIR}/animations/testing/index.js -o ${DESTDIR}/animations-testing.tmp.js

echo "====== Downleveling ${PACKAGE} ANIMATIONS TESTING to ES5/UMD"
[[ -e ${SRCDIR}/.babelrc-animations-testing ]] && cp ${SRCDIR}/.babelrc-animations-testing ${DESTDIR}/.babelrc
$BABELJS ${DESTDIR}/animations-testing.tmp.js -o ${UMD_ANIMATIONS_TESTING_ES5_PATH}
rm -f ${DESTDIR}/.babelrc

echo "====== Move ${PACKAGE} animations testing typings"
rsync -a --exclude=*.js --exclude=*.js.map ${DESTDIR}/animations/testing/ ${DESTDIR}/typings/animations/testing
mv ${DESTDIR}/typings/animations/testing/index.d.ts ${DESTDIR}/typings/animations/testing/testing.d.ts
mv ${DESTDIR}/typings/animations/testing/index.metadata.json ${DESTDIR}/typings/animations/testing/testing.metadata.json

rm -rf ${DESTDIR}/animations

mkdir ${DESTDIR}/animations && [[ -d ${DEST_MODULE}/${PACKAGE} ]] || mkdir ${DEST_MODULE}/${PACKAGE}
mkdir ${DESTDIR}/animations/testing

getPackageContents "${PACKAGE}" "animations" > ${DESTDIR}/animations/package.json

echo '{"typings": "../../typings/animations/testing/testing.d.ts", "main": "../../bundles/platform-browser-animations-testing.umd.js", "module": "../../@angular/platform-browser/animations/testing.es5.js", "es2015": "../../@angular/platform-browser/animations/testing.js"}' > ${DESTDIR}/animations/testing/package.json

mv ${DESTDIR}/animations.tmp.js ${JS_ANIMATIONS_PATH}
$BABELJS ${JS_ANIMATIONS_PATH} -o ${JS_ANIMATIONS_PATH_ES5}
cat ${LICENSE_BANNER} > ${UMD_ANIMATIONS_ES5_PATH}.tmp
cat ${UMD_ANIMATIONS_ES5_PATH} >> ${UMD_ANIMATIONS_ES5_PATH}.tmp
mv ${UMD_ANIMATIONS_ES5_PATH}.tmp ${UMD_ANIMATIONS_ES5_PATH}
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_ANIMATIONS_ES5_MIN_PATH} ${UMD_ANIMATIONS_ES5_PATH}

mkdir ${DEST_MODULE}/${PACKAGE}/animations

mv ${DESTDIR}/animations-testing.tmp.js ${JS_ANIMATIONS_TESTING_PATH}
$BABELJS ${JS_ANIMATIONS_TESTING_PATH} -o ${JS_ANIMATIONS_TESTING_PATH_ES5}
cat ${LICENSE_BANNER} > ${UMD_ANIMATIONS_TESTING_ES5_PATH}.tmp
cat ${UMD_ANIMATIONS_TESTING_ES5_PATH} >> ${UMD_ANIMATIONS_TESTING_ES5_PATH}.tmp
mv ${UMD_ANIMATIONS_TESTING_ES5_PATH}.tmp ${UMD_ANIMATIONS_TESTING_ES5_PATH}
fi
) 2>&1 | grep -v "as external dependency"

fi
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ gulp.task('tools:build', loadTask('tools-build'));
gulp.task('check-cycle', loadTask('check-cycle'));
gulp.task('serve', loadTask('serve', 'default'));
gulp.task('serve-examples', loadTask('serve', 'examples'));
gulp.task('changelog', loadTask('changelog'));
gulp.task('changelog', loadTask('changelog'));
18 changes: 0 additions & 18 deletions modules/@angular/animation/package.json

This file was deleted.

11 changes: 0 additions & 11 deletions modules/@angular/animation/src/animation.ts

This file was deleted.

35 changes: 0 additions & 35 deletions modules/@angular/animation/src/animation_module.ts

This file was deleted.

40 changes: 0 additions & 40 deletions modules/@angular/animation/src/dsl/animation_dsl_visitor.ts

This file was deleted.

31 changes: 0 additions & 31 deletions modules/@angular/animation/src/engine/animation_driver.ts

This file was deleted.

Loading

0 comments on commit 830393d

Please sign in to comment.