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

feat(Server): exclude client scripts for node targets #1441

Closed
wants to merge 1 commit into from

Conversation

EloB
Copy link

@EloB EloB commented Jul 11, 2018

git clone git@github.com:EloB/ssr.git
cd ssr/node_modules/webpack-dev-server # <- This is using my branch
npm install # Install all dependencies
npm run prepublish # To build all client scripts
cd ../../
npm run dev

Type

  • Feature

Issues

SemVer

  • Minor

@jsf-clabot
Copy link

jsf-clabot commented Jul 11, 2018

CLA assistant check
All committers have signed the CLA.

@EloB
Copy link
Author

EloB commented Jul 11, 2018

I saw another PR about this: #1338
One problem with that is that the websocket emit hashes that is node targets. That will crash hot reloading on web.

@codecov
Copy link

codecov bot commented Jul 11, 2018

Codecov Report

Merging #1441 into master will decrease coverage by 2.92%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1441      +/-   ##
==========================================
- Coverage   79.27%   76.35%   -2.93%     
==========================================
  Files           6        6              
  Lines         497      499       +2     
  Branches      161      163       +2     
==========================================
- Hits          394      381      -13     
- Misses        103      118      +15
Impacted Files Coverage Δ
lib/Server.js 77.97% <100%> (-4.3%) ⬇️
lib/util/addDevServerEntrypoints.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c1ff11...8328c02. Read the comment docs.

@@ -68,6 +68,7 @@ function Server(compiler, options, _log) {
}

const addCompilerHooks = (comp) => {
if (!['async-node', 'node'].includes(comp.options.target)) return;
Copy link
Author

Choose a reason for hiding this comment

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

This is to prevent websocket to not emit node target specific hashes.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Please add test

@EloB
Copy link
Author

EloB commented Aug 15, 2018

@evilebottnawi Did you read the description? 😄

Need help writing the tests.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Please add tests

@alexander-akait
Copy link
Member

@EloB oh sorry, i don't have time right now for this 😞 maybe someone other can help with this

@EloB
Copy link
Author

EloB commented Aug 15, 2018

@evilebottnawi No worry 😄👍 Lets hope someone has time!

@michael-ciniawsky michael-ciniawsky changed the title Exclude client script adding to node targets fix(Server): exclude node targets from being added as a client script Aug 21, 2018
@michael-ciniawsky michael-ciniawsky added this to the 3.1.6 milestone Aug 21, 2018
@michael-ciniawsky michael-ciniawsky changed the title fix(Server): exclude node targets from being added as a client script feat(Server): exclude client scripts for node targets Aug 26, 2018
@michael-ciniawsky michael-ciniawsky modified the milestones: 3.1.6, 3.2.0 Aug 26, 2018
@michael-ciniawsky
Copy link
Member

@codecov
Copy link

codecov bot commented Sep 18, 2018

Codecov Report

Merging #1441 into master will decrease coverage by 2.92%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1441      +/-   ##
==========================================
- Coverage   79.27%   76.35%   -2.93%     
==========================================
  Files           6        6              
  Lines         497      499       +2     
  Branches      161      163       +2     
==========================================
- Hits          394      381      -13     
- Misses        103      118      +15
Impacted Files Coverage Δ
lib/Server.js 77.97% <100%> (-4.3%) ⬇️
lib/util/addDevServerEntrypoints.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c1ff11...8328c02. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Sep 18, 2018

Codecov Report

Merging #1441 into master will decrease coverage by 2.92%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1441      +/-   ##
==========================================
- Coverage   79.27%   76.35%   -2.93%     
==========================================
  Files           6        6              
  Lines         497      499       +2     
  Branches      161      163       +2     
==========================================
- Hits          394      381      -13     
- Misses        103      118      +15
Impacted Files Coverage Δ
lib/Server.js 77.97% <100%> (-4.3%) ⬇️
lib/util/addDevServerEntrypoints.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c1ff11...8328c02. Read the comment docs.

@EloB
Copy link
Author

EloB commented Oct 26, 2018

If I have some time over this weekend I will try to fix this. I really want that hot reloading on server side :)

@alexander-akait
Copy link
Member

@EloB friendly ping

@j0j00
Copy link

j0j00 commented Dec 21, 2018

I'm looking to rebase this PR and write some tests for your PR so it can be merged in.

Do you have a sample use-case/webpack config for the websocket emission issue?

I don't think it's a good either to simply skip the compilation hooks in case some plugins rely on them to function.

@alexander-akait
Copy link
Member

@jojo-apollo why we need test websocket emission issue here?

@j0j00
Copy link

j0j00 commented Dec 21, 2018

This PR supposedly supercedes #1338, by attempting to solve some websocket hot reload issues which that PR doesn't address.

I don't have this websocket issue myself so I'm asking @EloB for clarification on a way to replicate it.

@alexander-akait
Copy link
Member

@jojo-apollo maybe we can test this manually

@j0j00
Copy link

j0j00 commented Dec 21, 2018

It's difficult to test if we don't know his exact use case, my node target currently uses custom plugins, so I have a feeling his change will break that.

I just want to confirm if it's an issue with way he wrote his webpack config (and he's configured or used it wrong).

https://webpack.js.org/concepts/targets/

@alexander-akait
Copy link
Member

@jojo-apollo let's wait 72 hours on answer and feel free to recreate PR

@EloB
Copy link
Author

EloB commented Jan 21, 2019

I managed to write a isomorphic webpack config without any changes or plugins with hot reload on both backend and frontend. When I have time I might be able to publish it.

@EloB EloB closed this Jan 21, 2019
@EloB EloB deleted the ssr-friendly branch January 21, 2019 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants