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
Update webpack@4.11.1 + Use TypeScript compiler instead of Babel #1762
Update webpack@4.11.1 + Use TypeScript compiler instead of Babel #1762
Conversation
How much faster? :) |
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 would still need to test it, but looks good so far 👍
@@ -14,19 +14,6 @@ const addAltAudioSupport = !!env.ALT_AUDIO || !!env.USE_ALT_AUDIO; | |||
const addEMESupport = !!env.EME_DRM || !!env.USE_EME_DRM; | |||
const runAnalyzer = !!env.ANALYZE; | |||
|
|||
const uglifyJsOptions = { |
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 like
@Korilakkuma Not sure if you knew, but the upgrade to webpack 4.x is already included in the Typescript toolchain PR: #1716 Wouldn't you want to continue this work maybe rather? It would be even a much more great contribution to the project! |
@Korilakkuma Also, if you like working on the toolchain, feel free to continue the work on that PR as well :) Or merge all together to one branch! #1631 |
@tchakabam Thank you for review.
Namely, I should change the merge destination of this PR to |
@Korilakkuma Maybe the simplest is I will just close #1631 because in the end it's not really much. If you see anything useful there feel free to merge in that branch into yours here. But then again, it's just making sure the OccurenceOrder plugin is not used in dev. You can just copy-paste that over :) The other stuff is pretty cosmetic. What would be more interesting to do would be to continue your work on the TypeScript branch (#1716), it already contains the upgrade to Webpack v4 which you have done here :) This is something really important actually, and it would be great if you would want to pick it up. |
…nto feature/update-webpack
package.json
Outdated
@@ -52,7 +52,7 @@ | |||
"test": "npm run test:unit && npm run test:func", | |||
"test:unit": "karma start karma.conf.js", | |||
"test:unit:watch": "karma start karma.conf.js --auto-watch --no-single-run", | |||
"test:func": "cross-env BABEL_ENV=test mocha --compilers js:babel-register tests/functional/auto/setup.js --timeout 40000" | |||
"test:func": "cross-env BABEL_ENV=test mocha --require ts-node/register tests/functional/auto/setup.js --timeout 40000" |
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.
👍 you can probably get rid or rename the BABEL_ENV
thing.
We were using ts-node
as well in another project for powering the toolchain, as we are writing everything down to the Webpack in Typescript. We were just calling scripts like so: ts-node ./node_modules/.bin/webpack
. So that's always still a possibility, just for info.
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.
you can probably get rid or rename the BABEL_ENV thing
👍
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.
not sure what it does or if we need a similar thing in typescript though.
Cool. Might be ready to merge ... :) |
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.
LGTM
package.json
Outdated
@@ -51,21 +52,16 @@ | |||
"test": "npm run test:unit && npm run test:func", | |||
"test:unit": "karma start karma.conf.js", | |||
"test:unit:watch": "karma start karma.conf.js --auto-watch --no-single-run", | |||
"test:func": "cross-env BABEL_ENV=test mocha --compilers js:babel-register tests/functional/auto/setup.js --timeout 40000" | |||
"test:func": "cross-env mocha --require ts-node/register tests/functional/auto/setup.js --timeout 40000" |
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.
Can you removecross-env
?
Because, it does not set env.
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.
OK. I try to remove cross-env
👍
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 removed cross-env
.
I removed |
webpack.config.js
Outdated
} | ||
|
||
return [enabledConfig, demoConfig]; | ||
console.log( | ||
`Building Hls.js with webpack config:\n\n${JSON.stringify(configs, null, 4)}\n` |
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.
Maybe even better: console.log(
Building configs: ${configs.map(config => config.name).join(', ')}.\n);
This will just display the names of all the configs being built :)
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.
👍
tsconfig.json
Outdated
{ | ||
"compilerOptions": { | ||
//"inlineSourceMap": true, | ||
"sourceMap": true, |
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.
are source-maps working correctly?
are they pointing straight into the js file, or into the tsc compiler output? :)
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.
The source maps are created as external file.
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.
Yes, that's good. But are they "working" ? I mean by that, are you able to debug the demo for example, and map a breakpoint into the original source-files? for example :)
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.
admitted, i could check this myself, but just asking ;)
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.
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.
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.
awesome 👍
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.
noUnusedLocals and noUnusedParameters might be good options to add
Very cool, just a few details to verifiy 👍 |
@tjenkinson Do you see anything else tbd? :) |
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.
Looks good to me!
OK. This should be good. But before we merge, I guess we should just validate this on IE11 "just to be sure". If I have well understood what Babel was doing, and what |
IE ✅ |
@Korilakkuma Very last thing: the package-lock file should be different, probably as you set karma to v3 again, you should have an unstaged change there as well after an install. Can you re-run |
I tried above procedure. But |
@Korilakkuma Thanks for checking this out 👍 This probably makes sense. Sorry I had you do this first, but I just checked what the diff on the package-lock actually is here for me, and I got this:
No idea why these few assets get resolved through http rather than https on my system :D But it's definitely not an actual issue. |
|
Before we merge this we could/should:
|
@Korilakkuma we would like to merge this soon, but with the todos above (so that we can seemlessly move on with converting components to TS). therefore, i would merge this here into a |
I changed |
@Korilakkuma Thanks! |
This PR will...
Updated
webpack@4.11.1
andwebpack.config.js
. Along with it, installedwebpack-cli
.Why is this Pull Request needed?
The build is faster than
webpack@3.5.5
. Therefore, I think CI finishes faster.Are there any points in the code the reviewer needs to double check?
Resolves issues:
Related PR
#1631
Checklist