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

Build: fix race condition in demo #8827

Merged
merged 1 commit into from Jun 29, 2017
Merged

Build: fix race condition in demo #8827

merged 1 commit into from Jun 29, 2017

Conversation

not-an-aardvark
Copy link
Member

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).

(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.
@not-an-aardvark not-an-aardvark added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly build This change relates to ESLint's build process labels Jun 28, 2017
@eslintbot
Copy link

LGTM

@mention-bot
Copy link

@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.

@aladdin-add
Copy link
Member

aladdin-add commented Jun 28, 2017

will it fix this?
image

occasionally glyphicons-halflings-regular.woff2 Failed to load resource.
since I'm using VPN, not sure it is network problem or a bug.

Copy link
Member

@gyandeeps gyandeeps left a 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.

@not-an-aardvark
Copy link
Member Author

@aladdin-add No, it doesn't fix that. However, I think that 404 error is unrelated. (I am also getting that error.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly build This change relates to ESLint's build process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Demo fails when loaded from cache
7 participants