gajus / isomorphic-webpack

Abstracts universal consumption of application code base using webpack.
Other
291 stars 17 forks source link

Make isomorphic-webpack work in Windows OS #9

Closed linh1987 closed 5 years ago

linh1987 commented 7 years ago

I added a few fixes and improvement to how isomorphic-webpack handling webpack configuration and cross environment path handling. It works fine with my private project as well as isomorphic-webpack-demo (a manual change in webpack version is needed).

I will put more comments in individual changes. But the biggest one is normalize path formats (".\something\something") to linux style path ("./something/something") so requestMap matching can work properly.

I'm in a bit rush with my work so the code is not as cleaned as it could be so feel free to comment.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.6%) to 96.552% when pulling ca85e4135ae3fdd0827af26c4c454a5e934ffec8 on linh1987:isomorphic-webpack_improvements into 57a2a92f3d4bfc4180405385790cca3575081dce on gajus:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.6%) to 96.552% when pulling ca85e4135ae3fdd0827af26c4c454a5e934ffec8 on linh1987:isomorphic-webpack_improvements into 57a2a92f3d4bfc4180405385790cca3575081dce on gajus:master.

linh1987 commented 7 years ago

I will add more unit tests later if needed.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.6%) to 96.552% when pulling db485f1f583f2eef17a319dd121e21c141669eff on linh1987:isomorphic-webpack_improvements into 867b3f680375f30d0e58daa0b10ee641055adb4d on gajus:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.6%) to 96.552% when pulling db485f1f583f2eef17a319dd121e21c141669eff on linh1987:isomorphic-webpack_improvements into 867b3f680375f30d0e58daa0b10ee641055adb4d on gajus:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.6%) to 96.552% when pulling db485f1f583f2eef17a319dd121e21c141669eff on linh1987:isomorphic-webpack_improvements into 867b3f680375f30d0e58daa0b10ee641055adb4d on gajus:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.6%) to 96.552% when pulling e634d71d99918513239acf62e91ac179df270a0b on linh1987:isomorphic-webpack_improvements into 867b3f680375f30d0e58daa0b10ee641055adb4d on gajus:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.6%) to 96.552% when pulling e634d71d99918513239acf62e91ac179df270a0b on linh1987:isomorphic-webpack_improvements into 867b3f680375f30d0e58daa0b10ee641055adb4d on gajus:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.6%) to 96.552% when pulling e634d71d99918513239acf62e91ac179df270a0b on linh1987:isomorphic-webpack_improvements into 867b3f680375f30d0e58daa0b10ee641055adb4d on gajus:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.6%) to 96.552% when pulling e634d71d99918513239acf62e91ac179df270a0b on linh1987:isomorphic-webpack_improvements into 867b3f680375f30d0e58daa0b10ee641055adb4d on gajus:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.6%) to 96.552% when pulling e634d71d99918513239acf62e91ac179df270a0b on linh1987:isomorphic-webpack_improvements into 867b3f680375f30d0e58daa0b10ee641055adb4d on gajus:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.6%) to 96.552% when pulling e634d71d99918513239acf62e91ac179df270a0b on linh1987:isomorphic-webpack_improvements into 867b3f680375f30d0e58daa0b10ee641055adb4d on gajus:master.

gajus commented 7 years ago

@linh1987 a fix for an array entry has been already added. https://github.com/gajus/isomorphic-webpack/commit/867b3f680375f30d0e58daa0b10ee641055adb4d Sorry, I have made the change before I saw your pull-request.

However, I appreciate the fix for windows support.

I am leaving this open until you confirm that it is ready for a review.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.1%) to 98.214% when pulling 76d5a24fa9790f8b027ccfc52fe900e8af1b38f1 on linh1987:isomorphic-webpack_improvements into 867b3f680375f30d0e58daa0b10ee641055adb4d on gajus:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.1%) to 98.214% when pulling 76d5a24fa9790f8b027ccfc52fe900e8af1b38f1 on linh1987:isomorphic-webpack_improvements into 867b3f680375f30d0e58daa0b10ee641055adb4d on gajus:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.1%) to 98.214% when pulling 76d5a24fa9790f8b027ccfc52fe900e8af1b38f1 on linh1987:isomorphic-webpack_improvements into 867b3f680375f30d0e58daa0b10ee641055adb4d on gajus:master.

linh1987 commented 7 years ago

@gajus it's completely fine. I updated the code to run correctly against the unit tests now. I feel the context check / test is a bit wonky (since path.dirname('/bar') returns '/' anyway, the parentFilename parameter for that test is a bit meaningless). What do you think?

Other than that it should be my final feature commit for this PR and you can review it.

gajus commented 7 years ago

@linh1987 can you rebase against the master and see if the changes continue to work? I have made some changes that could be platform specific.

linh1987 commented 7 years ago

I managed to merge but I don't know if i'm using the package right anymore. should I use the new evalBundleCode callback? it failed at jsdom.changeURL(window, windowUrl); where windowUrl is '/' @gajus

gajus commented 7 years ago

Please add more information about:

it failed at jsdom.changeURL(window, windowUrl); where windowUrl is '/' @gajus

I will improve the documentation. Generally, you need to call evalBundleCode only once if your application is not aware of the URL (ie, it does not perform routing). If it does perform routing, then you need to call if before each HTTP request.

gajus commented 7 years ago

@linh1987 Did my comment clear things up?

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.2%) to 90.909% when pulling 55c0fd5ecedfc7a8a5ebd5634f1a12420751e811 on linh1987:isomorphic-webpack_improvements into 50e8896e79023314adcb1471a48319bd842ee55b on gajus:master.

gajus commented 7 years ago

Thank you for coming back to this, @linh1987!

linh1987 commented 7 years ago

@gajus hey. sorry my work life took me away from this. I will get this finished (hopefully) in a few days.