JavaScript port

3 views
Skip to first unread message

J. Chris Anderson

unread,
Dec 18, 2008, 10:21:53 PM12/18/08
to Mimeparse-dev
I've created a JavaScript port of mimeparse.js for use by CouchDB.
I've posted a mimeparse repository that includes my changes to Github
here: http://github.com/jchris/mimeparse/tree/master

I've also attached the new (JavaScript + HTML test) files by uploading
to the Google group. They are here: http://groups.google.com/group/mimeparse-dev/web/mimeparse-js.zip

The dependency on json2.js is merely for the test runner, so the
library can be safely deployed without it. I've only tested on Firefox
3 and Safari, although I think the code should be pretty browser-
independent.

Best,
Chris

Steve Vinoski

unread,
Dec 18, 2008, 10:51:56 PM12/18/08
to jch...@apache.org, mimepa...@googlegroups.com

Hi Chris, very cool! Thanks for the contribution. I've looked through
it and it looks great, and I verified the tests.

Joe, I assume you're OK with me adding this to the mimeparse collection?

thanks,
--steve

Joe Gregorio

unread,
Dec 19, 2008, 9:56:22 AM12/19/08
to mimepa...@googlegroups.com, jch...@apache.org
Please do.

Chris, can we add you as a developer to the project?

Thanks,
-joe

>
> thanks,
> --steve
>
> >
>



--
Joe Gregorio http://bitworking.org

Steve Vinoski

unread,
Dec 19, 2008, 11:06:01 AM12/19/08
to jch...@apache.org, mimepa...@googlegroups.com
On 12/19/08, Joe Gregorio <j...@bitworking.org> wrote:
> Please do.

I've added and checked in the files, added a JavaScript example to the
wiki, and added a download file for the JavaScript code to the front
page.

Chris, I did make a change to the code: there was a call to
console.log in bestMatch, and that didn't work in Rhino (which I used
to make the wiki example), so I removed it. I hope that's OK with you.

--steve

Chris Anderson

unread,
Dec 19, 2008, 11:57:56 AM12/19/08
to Steve Vinoski, mimepa...@googlegroups.com
On Fri, Dec 19, 2008 at 6:56 AM, Joe Gregorio <j...@bitworking.org> wrote:
> Chris, can we add you as a developer to the project?

Thanks Joe. I'd be honored (and I have some cleanup to do).

On Fri, Dec 19, 2008 at 8:06 AM, Steve Vinoski <vin...@gmail.com> wrote:
> I've added and checked in the files, added a JavaScript example to the
> wiki, and added a download file for the JavaScript code to the front
> page.

Thanks. The only gotcha I see is that json2.js is missing from the
package, which is fine for the sake of mimeparse.js, but leaves the
tests broken here:

http://mimeparse.googlecode.com/svn/trunk/mimeparse-js-test.html

This is something I can fix when I'm added to the project. (assuming
that there's no objection to including json2.js in the repository.
It's public domain, so the only downside is the clutter of a file
needed only for the test runner. Actually, the best thing may be to
paste it inline into the test runner html, so no one gets confused and
thinks that its required to run mimeparse.js)

>
> Chris, I did make a change to the code: there was a call to
> console.log in bestMatch, and that didn't work in Rhino (which I used
> to make the wiki example), so I removed it. I hope that's OK with you.

No problem, Steve -- I have a bad habit of leaving those console.log
statements in. There are a couple others in the failing assertion
path, which I'll gladly clean up as well.

Chris

--
Chris Anderson
http://jchris.mfdz.com

Joe Gregorio

unread,
Dec 19, 2008, 12:13:02 PM12/19/08
to mimepa...@googlegroups.com
On Fri, Dec 19, 2008 at 11:57 AM, Chris Anderson <jch...@apache.org> wrote:
>
> On Fri, Dec 19, 2008 at 6:56 AM, Joe Gregorio <j...@bitworking.org> wrote:
>> Chris, can we add you as a developer to the project?
>
> Thanks Joe. I'd be honored (and I have some cleanup to do).


Excellent. I'll need a gmail account to add you to the project.

Thanks,
-joe

>
> On Fri, Dec 19, 2008 at 8:06 AM, Steve Vinoski <vin...@gmail.com> wrote:
>> I've added and checked in the files, added a JavaScript example to the
>> wiki, and added a download file for the JavaScript code to the front
>> page.
>
> Thanks. The only gotcha I see is that json2.js is missing from the
> package, which is fine for the sake of mimeparse.js, but leaves the
> tests broken here:
>
> http://mimeparse.googlecode.com/svn/trunk/mimeparse-js-test.html
>
> This is something I can fix when I'm added to the project. (assuming
> that there's no objection to including json2.js in the repository.
> It's public domain, so the only downside is the clutter of a file
> needed only for the test runner. Actually, the best thing may be to
> paste it inline into the test runner html, so no one gets confused and
> thinks that its required to run mimeparse.js)
>
>>
>> Chris, I did make a change to the code: there was a call to
>> console.log in bestMatch, and that didn't work in Rhino (which I used
>> to make the wiki example), so I removed it. I hope that's OK with you.
>
> No problem, Steve -- I have a bad habit of leaving those console.log
> statements in. There are a couple others in the failing assertion
> path, which I'll gladly clean up as well.
>
> Chris
>
> --
> Chris Anderson
> http://jchris.mfdz.com
>
> >
>



Chris Anderson

unread,
Dec 19, 2008, 12:18:41 PM12/19/08
to mimepa...@googlegroups.com
On Fri, Dec 19, 2008 at 9:13 AM, Joe Gregorio <j...@bitworking.org> wrote:
>
> On Fri, Dec 19, 2008 at 11:57 AM, Chris Anderson <jch...@apache.org> wrote:
>>
>> On Fri, Dec 19, 2008 at 6:56 AM, Joe Gregorio <j...@bitworking.org> wrote:
>>> Chris, can we add you as a developer to the project?
>>
>> Thanks Joe. I'd be honored (and I have some cleanup to do).
>
>
> Excellent. I'll need a gmail account to add you to the project.
>

jch...@gmail.com

Thanks

Joe Gregorio

unread,
Dec 19, 2008, 12:56:46 PM12/19/08
to mimepa...@googlegroups.com
Done, you've been added as an admin for the project.

Thanks,
-joe

>
> Thanks
>
> --
> Chris Anderson
> http://jchris.mfdz.com
>
> >
>



Chris Anderson

unread,
Dec 19, 2008, 1:25:44 PM12/19/08
to mimepa...@googlegroups.com
On Fri, Dec 19, 2008 at 9:56 AM, Joe Gregorio <j...@bitworking.org> wrote:
>
> Done, you've been added as an admin for the project.

Thanks. I've committed the debug-statement free version, and the test
cases now work fine at
http://mimeparse.googlecode.com/svn/trunk/mimeparse-js-test.html

I love testing in the browser!

Chris

Reply all
Reply to author
Forward
0 new messages