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

um... blasphemy but... what about .xml() ? #151

Closed
marcoscaceres opened this issue Nov 2, 2015 · 8 comments
Closed

um... blasphemy but... what about .xml() ? #151

marcoscaceres opened this issue Nov 2, 2015 · 8 comments

Comments

@marcoscaceres
Copy link
Member

I know, I know stop throwing tomatoes at me... but stupid piece of crap JSON's lack of comment support means we are doing things like this for localization (adding a global JS object! yeah... OMFG bad!!):

https://github.com/mozilla/remote-newtab/blob/gh-pages/src/locale/newTab.js

The above is better suited for XML, as we can have comments there. I imagine there is probably still quite a bit of XML out there also and I doubt browsers are going to drop support for it any time soon, yada yada yada....

@jakearchibald
Copy link
Collaborator

Dupe of #16

A method that took a stream…

fetch(url).then(r => parseDoc(r.body)).then(doc => )

…or a transform stream would be a better solution here.

@marcoscaceres
Copy link
Member Author

... yeah... I guess, but it seems to be putting purity before developer need. I'm happy to wait and see what feedback comes back from the wider web once fetch gets more adoption.

@annevk
Copy link
Member

annevk commented Nov 2, 2015

Well, please also consider the affect on potential non-browser implementations if we suddenly import all of XML/HTML as a dependency.

It's not really purity I think, just basic software engineering practices.

@marcoscaceres
Copy link
Member Author

Ok, I was not aware we were now in the business of specifying behaviour for non-browser implementations. That's a bit of a worry, specially given the dependencies on same origin and other browser-environment specific quirks. Which other platforms are implementing fetch?

@annevk
Copy link
Member

annevk commented Nov 2, 2015

I believe there's a number of implementations available for Node.js. They might leave out the CORS aspect there though since it makes less sense.

@yanlee26
Copy link

yanlee26 commented Jul 5, 2017

I do not think this is a good solution

@marcoscaceres
Copy link
Member Author

@yanlee26, with streams being part of to fetch, you can make a really nice SAX parser for XML. Also using @jakearchibald's solution works well.

@jakearchibald
Copy link
Collaborator

@yanlee26 you need to be clear on what in particular you don't like, along with reasons why, otherwise your comment is of no value.

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

No branches or pull requests

4 participants