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: refactor build script #4861
Conversation
// TODO: | ||
// - what about sourcemaps? | ||
// Angular itself has inline sourcemaps. I don't see the point, since you don't have sources | ||
// on the package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what to do about sourcemaps. I think the current ones are a bit weird and work only because the TS sourcefiles are bundled. We could inline sourcemaps but I'm not sure if that impacts parsing performance.
// Angular itself has inline sourcemaps. I don't see the point, since you don't have sources | ||
// on the package. | ||
// - what about shipping TS for bazel support? | ||
// I think this isn't needed anymore? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does RxJS still need to ship TS for Bazel support? I thought this wasn't needed anymore.
// Run BO over esm5 and esm2015 to remove side effects. | ||
console.log('# Removing side effects from esm5 and esm2015.'); | ||
const buildOptimizerOptions = { emitSourceMap: false, isSideEffectFree: true }; | ||
ls('./dist/formats/{esm5,esm2015}/**/*.js').forEach(inputFilePath => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running Build Optimizer over both ESM5 and ESM2015 should enable tree shaking for both (and prevent rollup/rollup#2415).
Hey, @filipesilva, this is old, and probably fell through the cracks when I left Google. I appreciate the effort, but I think we've got other solutions in place for now. Is it okay if we close this one? Or do you still see opportunity to improve what we have? |
SGTM Ben, no worries at all. |
Following a conversation with @benlesh, I'm taking a look at the tooling in RxJS to see where things can be simplified or removed.
I wanted to put this PR while it's still in progress to see if I'm missing important things or changing stuff I really shouldn't.
With the current changes, the
dist/
folder has a slightly different layout:The
ajax
,fetch
,operators
,testing
, andwebSocket
folders remain mostly the same. They are secondary entry points and just point to the format specific files. There's noindex.js
in them anymore though.The
formats
folder contains all the different supported formats:cjs
,esm2015
,esm5
, andtypings
. The UMD bundles are insidebundles
. Maybe they should also be insideformats
but since users do deep imports for them today, I left them in the same place.Then there's the license, package.json and readme in the top level.
I think this format still caters to all the same consumers are before, but is simpler and requires moving less stuff around. Along the way I tried to remove scripts that weren't needed anymore.
.make-packages.js
is now much smaller and does all the build/packaging tasks.I still have more scripts to look at and try to simplify but this is a start.
@benlesh (and others) please let me know what you think.