domReady() as Plugin to wirejs with Requirejs?

53 views
Skip to first unread message

Sexy Development

unread,
Aug 14, 2013, 1:34:13 PM8/14/13
to cuj...@googlegroups.com
Hello Everyone,

Thank you in advance for your assistance.

I would like to specify that the requirejs version of domReady() (at the link below) be used as part of wirejs. What is the correct way to wire this?
https://github.com/requirejs/domReady

The attempt was made to include an entry as part of the plugins key, as follows, but this appears to be causing an error. The object itself--which is clearly not a function--is being queued for execution on document ready, and is causing a type error.

WIRE SPEC EXCERPT:

```javascript
    plugins: [{
        module: "wire/dom"
    } , {
        module: "wire/domReady"
    }]
};
```

Also, please note that in our require.config file, two entries exist for wire.

1. wire is included in the packages object...
```javascript
           ,{
                "name": "wire",
                "location": "wire-0.10.1",
                "main": "wire"
            }
```

2. wire/domReady is mapped using the "map" key:

```javascript
                ,"wire/domReady": "domReady",
```


Scott Andrews

unread,
Aug 14, 2013, 2:53:39 PM8/14/13
to cuj...@googlegroups.com
Hey Sexy, (I never get to legitimately write that)

You shouldn't need to do anything special, just use the `wire/domReady` as is.  In your code above, remove item #2.

`wire/domReady` is a wire plugin wrapping the `domReady!` AMD plugin.  `domReady!` will resolve according to the AMD loader config, not anything special in wire.

-Scott



--
You received this message because you are subscribed to the Google Groups "cujojs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cujojs+un...@googlegroups.com.
To post to this group, send email to cuj...@googlegroups.com.
Visit this group at http://groups.google.com/group/cujojs.
To view this discussion on the web visit https://groups.google.com/d/msgid/cujojs/180c85c5-fdd9-40cb-8c38-592cfe929a77%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Sexy Development

unread,
Aug 14, 2013, 3:22:09 PM8/14/13
to
Thank you!!!

unscriptable

unread,
Aug 14, 2013, 9:18:55 PM8/14/13
to cuj...@googlegroups.com
If Scott's advice worked, then you probably put requirejs's domReady.js module at the baseUrl of your project.  This is what James Burke recommends because the loader can find things at the root without mapping paths.  If you decide to move the domReady.js file somewhere else, that's when you'll need to configure a path to its location.

paths: {
   
// other paths are here...

   
// map domReady to a folder
    domReady
: 'where/I/put/domReady'
}



-- John


On Wednesday, August 14, 2013 3:21:39 PM UTC-4, Sexy Development wrote:
Thank you!!!

On Wednesday, August 14, 2013 1:34:13 PM UTC-4, Sexy Development wrote:
Reply all
Reply to author
Forward
0 new messages