-
Notifications
You must be signed in to change notification settings - Fork 44
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
Support for ignoring lazy (not weak) async imports #67
Comments
The main problem here was a circular import that caused a component to be imported as `undefined`. I found a webpack plugin that can help us detect these—turned on warnings for now, but there are too many to fix currently. Also the plugin doesn't understand that our async imports are a valid way of breaking cycles (aackerman/circular-dependency-plugin#67). One of the stories had a timing issue — I looked deeper for how to address this, but I think some problems stem from hacky use of `ref` as a way of detecting `onMount` in class components... ideally we would convert everything here to hooks, but that is too big a task for this PR, so just adding a band-aid on this story for now. I also found that the Layout stories pertain to enabling map height rendering for the Cruise internal map, so are irrelevant here (reverting part of cruise-automation/webviz@6eb6fd9).
After some further testing I've noticed that this reproduces when using TypeScript with the compiler flag |
The main problem here was a circular import that caused a component to be imported as `undefined`. I found a webpack plugin that can help us detect these—turned on warnings for now, but there are too many to fix currently. Also the plugin doesn't understand that our async imports are a valid way of breaking cycles (aackerman/circular-dependency-plugin#67). One of the stories had a timing issue — I looked deeper for how to address this, but I think some problems stem from hacky use of `ref` as a way of detecting `onMount` in class components... ideally we would convert everything here to hooks, but that is too big a task for this PR, so just adding a band-aid on this story for now. I also found that the Layout stories pertain to enabling map height rendering for the Cruise internal map, so are irrelevant here (reverting part of cruise-automation/webviz@6eb6fd9).
The main problem here was a circular import that caused a component to be imported as `undefined`. I found a webpack plugin that can help us detect these—turned on warnings for now, but there are too many to fix currently. Also the plugin doesn't understand that our async imports are a valid way of breaking cycles (aackerman/circular-dependency-plugin#67). One of the stories had a timing issue — I looked deeper for how to address this, but I think some problems stem from hacky use of `ref` as a way of detecting `onMount` in class components... ideally we would convert everything here to hooks, but that is too big a task for this PR, so just adding a band-aid on this story for now. I also found that the Layout stories pertain to enabling map height rendering for the Cruise internal map, so are irrelevant here (reverting part of cruise-automation/webviz@6eb6fd9).
The main problem here was a circular import that caused a component to be imported as `undefined`. I found a webpack plugin that can help us detect these—turned on warnings for now, but there are too many to fix currently. Also the plugin doesn't understand that our async imports are a valid way of breaking cycles (aackerman/circular-dependency-plugin#67). One of the stories had a timing issue — I looked deeper for how to address this, but I think some problems stem from hacky use of `ref` as a way of detecting `onMount` in class components... ideally we would convert everything here to hooks, but that is too big a task for this PR, so just adding a band-aid on this story for now. I also found that the Layout stories pertain to enabling map height rendering for the Cruise internal map, so are irrelevant here (reverting part of cruise-automation/webviz@6eb6fd9).
The main problem here was a circular import that caused a component to be imported as `undefined`. I found a webpack plugin that can help us detect these—turned on warnings for now, but there are too many to fix currently. Also the plugin doesn't understand that our async imports are a valid way of breaking cycles (aackerman/circular-dependency-plugin#67). One of the stories had a timing issue — I looked deeper for how to address this, but I think some problems stem from hacky use of `ref` as a way of detecting `onMount` in class components... ideally we would convert everything here to hooks, but that is too big a task for this PR, so just adding a band-aid on this story for now. I also found that the Layout stories pertain to enabling map height rendering for the Cruise internal map, so are irrelevant here (reverting part of cruise-automation/webviz@6eb6fd9).
I'd love to fix this, but I haven't any clue how to tell from a Here's what circular-dependency-plugin looks at: circular-dependency-plugin/index.js Line 104 in 21777bf
And the source from webpack: It's really frustrating how hard it is to find a reference for webpack APIs like this. |
The note on allowAsyncCycles gives an example of using it for weak imports:
But it would be nice if this also worked for regular async imports that aren't marked with
webpackMode: "weak"
. It sounds like the default mode for async imports islazy
. https://webpack.js.org/api/module-methods/#magic-commentsThe text was updated successfully, but these errors were encountered: