forwardemail / forwardemail/superagent

Should browser parsers be asynchronous?

Open
#549 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
16.6k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

I'm trying to use the xml2js modules on client and server, but because superagent.parser on the browser is synchronous and in node is synchronous, I cannot create a single parse function for xml.

Given the current control flow, there isn't an easy way for me to monkey patch parseBody on the browser for an async method so I wonder if browser parsers be asynchronous in general and the client architecture updated to match.

I have another option to try to implement two different versions of xml parsers (sync in the browser and async in the server) and to ensure they are consistent, but this is a lot of work.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.