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
Build: fix race condition in demo #8827
Conversation
(fixes eslint/archive-website#363) Since 3ec436e was committed, the demo at http://eslint.org/demo has occasionally failed to load properly -- see eslint/archive-website#363 for more details. It appears that the issue was caused by a change to the build process in that commit which involved placing two browserified modules in the same bundle file. Based on #8465 (comment) this was changed in order to pass the tests in karma, but the tests seem to pass without the change. I'm not exactly sure what the root cause of the issue is. It only occurs when an unrelated file is loaded by requirejs after the eslint bundle, and that unrelated load files. My best guess at the moment is that requirejs was only able to infer the module name of the eslint bundle correctly when it contained a single anonymous module. When it contained two anonymous modules, requirejs couldn't infer their names, so it threw an error if there were no more modules to load after that. Depending on the state of the browser cache and the network, there would only sometimes be another module left to load after loading the eslint bundle, so this led to seemingly random errors in the demo.
LGTM |
@not-an-aardvark, thanks for your PR! By analyzing the history of the files in this pull request, we identified @nzakas, @mysticatea and @kaicataldo to be potential reviewers. |
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.
LGTM. Its not an issue anymore because your previous commit removed require for Rules
class.
@aladdin-add No, it doesn't fix that. However, I think that 404 error is unrelated. (I am also getting that error.) |
What is the purpose of this pull request? (put an "X" next to item)
[x] Bug fix (fixes eslint/archive-website#363)
What changes did you make? (Give an overview)
Since 3ec436e was committed, the demo at http://eslint.org/demo has occasionally failed to load properly -- see eslint/archive-website#363 for more details. It appears that the issue was caused by a change to the build process in that commit which involved placing two browserified modules in the same bundle file. Based on #8465 (comment) this was changed in order to pass the tests in karma, but the tests seem to pass without the change.
I'm not exactly sure what the root cause of the issue is. It only occurs when an unrelated file is loaded by requirejs after the eslint bundle, and that unrelated load files. My best guess at the moment is that requirejs was only able to infer the module name of the eslint bundle correctly when it contained a single anonymous module. When it contained two anonymous modules, requirejs couldn't infer their names, so it threw an error if there were no more modules to load after that. Depending on the state of the browser cache and the network, there would only sometimes be another module left to load after loading the eslint bundle, so this led to seemingly random errors in the demo.
Is there anything you'd like reviewers to focus on?
If anyone knows the root cause of the issue, I'd be interested to hear it.
Also cc @gyandeeps to make sure I'm not breaking anything from #8465 (comment).