Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix secondary entry point es5 output and core Rx references #14820

Merged
merged 1 commit into from
Mar 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ getPackageContents() {
# None
#######################################
downlevelES2015() {
echo '{"presets": [ ["es2015", { "modules": false }] ], "compact": true }' > ${1}/.babelrc
echo '{"presets": [ ["es2015", { "modules": false }] ], "compact": false }' > ${1}/.babelrc
$BABELJS ${2} -o ${3}
rm -f ${1}/.babelrc
}
Expand Down Expand Up @@ -293,7 +293,7 @@ do
rm -f ${DISTDIR}/.babelrc
if [[ -d ${DEST_MODULE} ]]; then
echo "====== Downleveling ES2015 to ESM/ES5"
downlevelES2015 ${DEST_MODULE} ${JS_PATH} ${JS_PATH_ES5}
downlevelES2015 ${DESTDIR} ${JS_PATH} ${JS_PATH_ES5}
fi

if [[ -d testing ]]; then
Expand All @@ -315,7 +315,7 @@ do
getPackageContents "${PACKAGE}" "testing" "index" > ${DESTDIR}/testing/package.json

mv ${DESTDIR}/testing.tmp.js ${JS_TESTING_PATH}
$BABELJS ${JS_TESTING_PATH} -o ${JS_TESTING_PATH_ES5}
downlevelES2015 ${DESTDIR} ${JS_TESTING_PATH} ${JS_TESTING_PATH_ES5}
cat ${LICENSE_BANNER} > ${UMD_TESTING_ES5_PATH}.tmp
cat ${UMD_TESTING_ES5_PATH} >> ${UMD_TESTING_ES5_PATH}.tmp
mv ${UMD_TESTING_ES5_PATH}.tmp ${UMD_TESTING_ES5_PATH}
Expand All @@ -341,7 +341,7 @@ do
getPackageContents "${PACKAGE}" "static"> ${DESTDIR}/static/package.json

mv ${DESTDIR}/static.tmp.js ${JS_STATIC_PATH}
$BABELJS ${JS_STATIC_PATH} -o ${JS_STATIC_PATH_ES5}
downlevelES2015 ${DESTDIR} ${JS_STATIC_PATH} ${JS_STATIC_PATH_ES5}
cat ${LICENSE_BANNER} > ${UMD_STATIC_ES5_PATH}.tmp
cat ${UMD_STATIC_ES5_PATH} >> ${UMD_STATIC_ES5_PATH}.tmp
mv ${UMD_STATIC_ES5_PATH}.tmp ${UMD_STATIC_ES5_PATH}
Expand All @@ -368,7 +368,7 @@ do
getPackageContents "${PACKAGE}" "upgrade" > ${DESTDIR}/upgrade/package.json

mv ${DESTDIR}/upgrade.tmp.js ${JS_UPGRADE_PATH}
$BABELJS ${JS_UPGRADE_PATH} -o ${JS_UPGRADE_PATH_ES5}
downlevelES2015 ${DESTDIR} ${JS_UPGRADE_PATH} ${JS_UPGRADE_PATH_ES5}
cat ${LICENSE_BANNER} > ${UMD_UPGRADE_ES5_PATH}.tmp
cat ${UMD_UPGRADE_ES5_PATH} >> ${UMD_UPGRADE_ES5_PATH}.tmp
mv ${UMD_UPGRADE_ES5_PATH}.tmp ${UMD_UPGRADE_ES5_PATH}
Expand Down Expand Up @@ -408,9 +408,11 @@ do
getPackageContents "${PACKAGE}" "animations" > ${DESTDIR}/animations/package.json

echo '{"typings": "../../typings/animations/testing/index.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
# This is needed for Compiler to be able to find the bundle index.
echo '{"typings": "animations.d.ts"}' > ${DESTDIR}/typings/animations/package.json

mv ${DESTDIR}/animations.tmp.js ${JS_ANIMATIONS_PATH}
$BABELJS ${JS_ANIMATIONS_PATH} -o ${JS_ANIMATIONS_PATH_ES5}
downlevelES2015 ${DESTDIR} ${JS_ANIMATIONS_PATH} ${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}
Expand All @@ -419,7 +421,7 @@ do
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}
downlevelES2015 ${DESTDIR} ${JS_ANIMATIONS_TESTING_PATH} ${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}
Expand Down
11 changes: 10 additions & 1 deletion modules/@angular/core/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@
"plugins": [["transform-es2015-modules-umd", {
"globals": {
"@angular/core": "ng.core",
"rxjs/Subject": "Rx"
"rxjs/Subject": "Rx",
"rxjs/Observable": "Rx",
"rxjs/Observer": "Rx",
"rxjs/Subscription": "Rx",

"rxjs/symbol/observable": "Rx.Symbol.observable",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just not sure this is correct. I created an issue on rxjs repo ReactiveX/rxjs#2415 but they haven't answered anything >_<

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, looks like you're right. Leaving in atm since this is going back to what previous rollup.config.js was. But it looks like it will be broken until the issue you filed gets fixed.


"rxjs/observable/merge": "Rx.Observable",

"rxjs/operator/share": "Rx.Observable.prototype"
},
"exactGlobals": true
}]],
Expand Down