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

Change domReady to use callback instead of plugin #15

Closed
wants to merge 1 commit into from

Conversation

ismell
Copy link
Contributor

@ismell ismell commented Jan 19, 2012

We need to use the callback instead of the plugin
because the plugin is constrained by the loaders
time out. So if the dom takes a while to load
then the loader will think the plugin failed
to load and cause it to time out.

We need to use the callback instead of the plugin
because the plugin is constrained by the loaders
time out. So if the dom takes a while to load
then the loader will think the plugin failed
to load and cause it to time out.
@briancavalier
Copy link
Member

Closing this after discussion, and opening #16 to track the domReady issue.

@briancavalier
Copy link
Member

I just had a thought that might help your specific case, Raul. Did you try remapping wire/domReady directly to RequireJS's domReady module? Something like:

// RequireJS config
paths: {
    'wire/domReady': 'path/to/requirejs/domReady',
    // more paths ...
}

I think that should work, but let me know if you try it.

@briancavalier
Copy link
Member

I just tested it to make sure, and it worked just fine. In fact, it means 1 less module to load (wire/domReady). This seems like a pretty reasonable alternative for situations like yours where DOMReady might cause module loading to fail. It definitely needs to be documented tho! I'll add that to #16

@ismell
Copy link
Contributor Author

ismell commented Jan 26, 2012

Currently our page builder does not support wiring specific paths. It only adds packages to the require config. Might have to try and integrate that in.

Thanks!

@unscriptable
Copy link
Member

I read James's reply on your link, @ismell, but this sure feels like a requirejs bug to me. Anything called DOM-ready should be waiting for the DOM, not modules, imho.

@unscriptable
Copy link
Member

fwiw, the dojo loader uses a timeout by default (when in a browser), but the config setting, waitSeconds, is 0 (disabled) by default, so it's effectively turned off.

@briancavalier
Copy link
Member

FYI, just added to the wiki: Dealing with DOMReady

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants