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

Cleanup client build setup, fix IE<=11 compatibility #1270

Merged
merged 2 commits into from
Jan 14, 2018

Conversation

yyx990803
Copy link
Contributor

@yyx990803 yyx990803 commented Jan 10, 2018

  • This is a bugfix
  • This is a code refactor
  • This is a test update
  • This is a typo fix
  • This is a metadata update

For Bugs and Features; did you add new tests?

No, because the bug case is CLI usage only and not testable in the current test setup.

Motivation / Use-Case

Fixes #1268.

#1242 was attempting to fix older browser compatibility by transpiling client bundles with babel. However I didn't notice that the bundles are not used in all cases. It introduced a regression which causes client files to contain ES2015 code when using inline mode via the CLI. This PR fixes that by ensuring the client injected in lib/util/addDevServerEntrypoints.js is the transpiled version as well.

Breaking Changes

None.

Additional Info

Notable Changes

  • Previously, source files for all 3 clients and their built bundles are mixed in the same directory, making it very confusing. This PR reorganized client files by moving all client source files in to a separate directory, /client-src, and further separating the three clients into their own directories:

    • /client-src/default
    • /client-src/live
    • /client-src/sockjs
  • In addition to the bundles, files in /client-src/default are transpiled directly via babel-cli so that they can be bundled directly in inline mode. (see transpile:index script)

  • /client now holds only built/transpiled bundles and files, and is added to .gitignore. Built files and bundles have the exact same file layout with pre-PR state of /client, so it should provide complete backwards compat.

@yyx990803 yyx990803 changed the title Cleanup client build setup, fix #1268 Cleanup client build setup, fix IE<11 compatibility Jan 10, 2018
@yyx990803 yyx990803 changed the title Cleanup client build setup, fix IE<11 compatibility Cleanup client build setup, fix IE<=11 compatibility Jan 10, 2018
Copy link
Member

@TheLarkInn TheLarkInn left a comment

Choose a reason for hiding this comment

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

This looks good from what I can see except for the one comment I have. (I could be wrong so please feel free to correct me).

I'll approve once comment addressed and then I'll also have @sokra and @SpaceK33z review because of the importance of this PR. Thanks for all the time and effort that you spent on this Evan.

@@ -0,0 +1,3 @@
{
"presets": ["env"]
Copy link
Member

Choose a reason for hiding this comment

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

This would default to CJS module output no? If so, should we be switching this to "modules":false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The client source is still using require, so having modules: false has no effect. Or we can convert to use ES modules imports and enable modules: false, but that may break compat with webpack 2 (not sure if that's still a requirement)

@EloB
Copy link

EloB commented Jan 13, 2018

I really hope that you merge this request. It's not just old desktop browsers (that are very easy to upgrade) but other smart devices that has web apps installed on them. That you cannot upgrade. For instance smart tvs/consoles etc. I ran into this issue some days ago and it took me many days before I found out that it was let/const inside the bundle. That was the bug because the lack of debugging tools inside these devices.

@TheLarkInn
Copy link
Member

TheLarkInn commented Jan 13, 2018 via email

@webpack webpack deleted a comment from codecov bot Jan 14, 2018
Copy link
Member

@SpaceK33z SpaceK33z left a comment

Choose a reason for hiding this comment

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

Looking good. I haven't maintained WDS for some time, but I fully agree with the IE<=11 compat and the implementation looks fine.

@TheLarkInn your comment was answered, so I assume you also approve now?

Copy link
Member

@sokra sokra left a comment

Choose a reason for hiding this comment

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

LGTM

@sokra sokra merged commit b0fa5f6 into webpack:master Jan 14, 2018
@sokra
Copy link
Member

sokra commented Jan 14, 2018

Thanks

@tobilen
Copy link

tobilen commented Jan 14, 2018

@sokra looks like dependencies are still not being transpiled (SS taken with Win8 / IE10):

screen shot 2018-01-14 at 15 07 48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IE11 fails to load with Invalid character error
6 participants