-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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(webpack-preprocessor): Allow to pass custom webpack output #14599
feat(webpack-preprocessor): Allow to pass custom webpack output #14599
Conversation
Thanks for taking the time to open a PR!
|
Not sure who I have to tag in here, hope that @bahmutov will be the right person to address this. |
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 am not sure it will work with lazy-loaded modules (cypress has some limitations here – only allows to host 1 javascript file per spec). There is a test https://github.com/cypress-io/cypress/blob/develop/npm/react/cypress/component/advanced/lazy-loaded-suspense/lazy-loaded-suspense.spec.tsx that can check the desired behavior.
Can you please uncomment it and make sure that CI passed? If it passed – that would be awesome :)
Thank you
@dmtrKovalenko I am pretty sure it will work with Lazy loaded components as I showed in my screenshots. Here is my usage: I have a component that wrapped into HOC which lazy loads another component (popup) and I got a Webpack error, not React or Cypress. Right now as a fix I'm editing Also, sorry, I didn't get what particularly should I uncomment? I see that the code you mentioned is uncommented. |
Cool if so, sorry just remove the |
@dmtrKovalenko ok, will do. But my fix is not about that at all. My fix is particularly about webpack-preprocessor and webpack error, not about Cypress and React.Lazy. I didn't change any code in Cypress core |
I understand this, but PR title says that React.lazy breaks the webpack-preprocessor code, right? Or did I miss something? |
@@ -151,6 +151,20 @@ describe('webpack preprocessor', function () { | |||
}) | |||
}) | |||
|
|||
it('adds output options when user output options are non-default', function () { |
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.
This test doesn't really check that when we have dynamic import somewhere that webpack doesn't crash. It only checks that specific options passed to webpack config.
What do you think about adding more complex test that shows the desired behavior if @cypress/react tests won't work?
Probably this is incorrect to name PR as I named it here. I named it Please note, this is just "pseudo code" |
Cool, thx its more clear now. Then it should be not |
Agreed, do you want me to create new PR with using new branch? |
I think just rename the title |
@dmtrKovalenko sounds good, thanks |
@dmtrKovalenko ok, so do you want me to do something else? Write Cypress tests? |
It may be nice to add e2e tests in webpack-preprocessor that shows how it works, but maybe that is not needed. :) |
Ok, thanks! I see some weird behavior with some checks, that related to code I haven't touched. Not sure why it happened. |
Hey @dmtrKovalenko |
@vtereshyn this error is coming from |
f03fb78
to
685f11e
Compare
@dmtrKovalenko any thoughts? |
well, I am not getting any responses, so I'm gonna close this PR. @dmtrKovalenko @jennifer-shehane |
Do not close it, I'll take a look once get some free time |
@vtereshyn when you run the tests locally you may need to build |
@lmiller1990 thanks for your suggestion. I did |
…config fix: webpack-preprocessor-lazy-load - React lazy load breaks webpack config
685f11e
to
f09cd75
Compare
Will take a look! |
I ran the tests locally and reproduced the error once. But then I ran them again and it all seemed fine. I'll try re-running CI and see what happens. |
@lmiller1990 thank you |
React.lazy
throws webpack error #14592User facing changelog
The user who uses
@cypress/webpack-preprocessor
has the ability to set his/her own WebpackpublicPath
Additional details
Please, see #14592 for additional explanation.
How has the user experience changed?
Before:
After:
PR Tasks