Re: Merged a lot

I think the blog article is correct - but going about it the hard way IMO.
The way that I've written the boolean test with the require statement
provides not only the modularity but also the ability to bring in
dependencies. Moreover it removes all of the additional cruft (the define
statement is useless as you still use the require func call to get the
dependency).

As a pattern I feel that the way the web-idl-type-boolean.js file is
structured is the easiest way forward using the AMD pattern for modules
while not blocking extensibility.



On 1/14/13 9:48 AM, "Marcos Caceres" <w3c@marcosc.com> wrote:

>
>
>
>On Monday, January 14, 2013 at 4:40 PM, Clint Hill wrote:
>
>> Marcos: I'm glad you showed this as I just committed a Boolean test
>> fixture. I also used AMD. But we have different approaches (I'm using
>> require and you use define). I put my test in
>> "web-idl-type-boolean-tests.js" in the /test directory.
>> 
>> I think my pattern is a little lighter than yours and might make test
>> writing a bit easier?
>
>I actually started there, but after a few hours switched to using define
>as I started hitting problems.
>
>The problem was that you then needed another file to load in all the
>interfaces. Like:
>
>require(["type/Boolean", "type/Byte", and so on])
>
>Plus:
>
>require(["test-file-1.js", "test-file2.js"])
>
>Using define, overcomes this problem and makes everything self contained.
>I also found other people recommending this approach. See, for example:
>
>http://www.jonnyreeves.co.uk/2012/qunit-and-requirejs/
>
>
>> I'm happy contribute to the test writing as maybe that's a way to get
>> blind taste tests since I didn't write the implementations?
>
>That would be great. But please make sure you copy/paste from the WebIDL
>spec as I've done. It helps make sure that we have a 1-to-1 test suite
>and implementation.
>> Maybe that
>> will create a cleaner validation process of the implementations this
>>way.
>> 
>> Thoughts?
>
>
>-- 
>Marcos Caceres
>
>
>

Received on Monday, 14 January 2013 17:19:13 UTC