Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #124299

Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro]

Path csiph.com!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Mild Shock <janburse@fastmail.fm>
Newsgroups comp.lang.javascript
Subject Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro]
Date Wed, 13 Mar 2024 13:40:39 +0100
Message-ID <uss6s7$1a5rg$1@solani.org> (permalink)
References <usquog$19ifk$1@solani.org> <1clu637150wl5.locsf12fk0z0.dlg@40tude.net>
MIME-Version 1.0
Content-Type text/plain; charset=ISO-8859-7; format=flowed
Content-Transfer-Encoding 8bit
Injection-Date Wed, 13 Mar 2024 12:40:40 -0000 (UTC)
Injection-Info solani.org; logging-data="1382256"; mail-complaints-to="abuse@news.solani.org"
User-Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.18.1
Cancel-Lock sha1:5XRoUELueWxskMH7k76YQNbH4I8=
X-User-ID eJwFwQkBwDAIA0BLtJRPDoPEv4Tdmfrxiefmz2hsvb0+B3JtPCCKjiA1coXFb6lbYkkVgFCgS6qQi03jD3JbFtA=
In-Reply-To <1clu637150wl5.locsf12fk0z0.dlg@40tude.net>
Xref csiph.com comp.lang.javascript:124299

Show key headers only | View raw


I made a DOM example with fetch. You need to
lookup webstreams. Node.JS braught both
webstreams AND fetch. I posted this example,

maybe it was in another thread. But here it is again.
You get the most bang out of fetch, when you use
it with webstreams. Here is a little example:

    await response.body
       .pipeThrough(new TextDecoderStream())
       .pipeTo(targetDiv.writable)

See also here:

Streaming element with backpressure demo
https://streams.spec.whatwg.org/demos/streaming-element-backpressure.html

Here is the node.JS announcement again, it
brings webstreams AND fetch, 2 modules
(in words **TWO** modules):

 > Notable Changes - Oct 17, 2023
 > The recent update to Node.js, version 21, includes
 > an important change to the fetch module as well as
 > WebStreams . Both modules were marked as stable
 > after a recent update.
https://nodejs.org/en/blog/announcements/v21-release-announce

But I don't know the exact feature matrice,
between fetch and XHR. Maybe googling you find
somebody who made such a feature matrice, comparing

the two with respect to functional and non-functional
requirements implemented.

JJ schrieb:
> On Wed, 13 Mar 2024 02:16:01 +0100, Mild Shock wrote:
>> Important information for Lawrence D'Oliveiro.
>> Basically you need to depend on a 3rd party that
>> did implememt the xmlhttprequest node module.
>>
>> Namely this here:
>> https://www.npmjs.com/package/xmlhttprequest
>>
>> You also need to install it besides the node.js
>> installation itself. You need to install the
>> node module package xmlhttprequest.
>>
>> With fetch() you only need to install node.js,
>> and nothing else. Because since release 21,
>> fetch() is already part of native Node.js.
>>
>> I wrote this already, but I can repeat it of
>> course again and again and again for you:
>>
>>   > Notable Changes - Oct 17, 2023
>>   > The recent update to Node.js, version 21, includes
>>   > an important change to the fetch module as well as
>>   > WebStreams . Both modules were marked as stable
>>   > after a recent update.
>> https://nodejs.org/en/blog/announcements/v21-release-announce
>>
>> Please feel free to ask more questions if
>> your skull can not digest the information of
>> a difference between these two concepts:
>> - 3rd party API
>> - native API
>>
>> Best is if you open a separate thread to
>> cleanup your confusion. Or see a psychatrist.
>>
>> Mild Shock schrieb:
>>   > Natively Node.js does not provide the browser XHR API.
>>   > There is, however, a node module xmlhttprequest that does.
>>   >
>>   > Lawrence D'Oliveiro schrieb:
>>   >> On Tue, 12 Mar 2024 00:19:57 +0100, Mild Shock wrote:
>>   >>
>>   >>> The same code runs on nodeJS.
>>   >>> No need to install some XHR library.
>>   >>
>>   >> You don’t know how to use XMLHttpRequest directly?
>>   >>
>>   >
> 
> Isn't that a matter of API specifications? Where Fetch is part of ECMAScript
> specification, and XMLHttpRequest is part of DOM specification.
> 
> Node.js is only an implementation of ECMAScript. It doesn't have any for
> DOM. i.e. no XMLHttpRequest, by default.
> 

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-13 02:16 +0100
  Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-13 02:35 +0100
    Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-13 12:57 +0100
      Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-13 13:01 +0100
      Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] John Harris <niam@jghnorth.org.uk.invalid> - 2024-03-13 14:57 +0000
        Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-13 17:02 +0100
          Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] John Harris <niam@jghnorth.org.uk.invalid> - 2024-03-14 18:58 +0000
            Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-15 10:00 +0100
              Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] John Harris <niam@jghnorth.org.uk.invalid> - 2024-03-15 14:06 +0000
                Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-15 16:05 +0100
                Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] John Harris <niam@jghnorth.org.uk.invalid> - 2024-03-16 15:11 +0000
                Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-16 18:11 +0100
                Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-16 18:18 +0100
                Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-16 18:30 +0100
                Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-16 19:01 +0100
                Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-16 19:05 +0100
                Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-16 19:08 +0100
                Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] John Harris <niam@jghnorth.org.uk.invalid> - 2024-03-18 14:35 +0000
                Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-18 18:49 +0100
                Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] John Harris <niam@jghnorth.org.uk.invalid> - 2024-03-19 10:50 +0000
                Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-19 14:27 +0100
        Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-13 17:04 +0100
          Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-13 17:13 +0100
        Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-29 00:28 +0100
          Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-29 00:32 +0100
            Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-29 00:42 +0100
              Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-29 00:46 +0100
                Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-29 00:47 +0100
  Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] JJ <jj4public@outlook.com> - 2024-03-13 19:24 +0700
    Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-13 13:40 +0100
      Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-13 14:00 +0100
        Re: Difference between 3rd party and native [Confusion by Lawrence D'Oliveiro] Mild Shock <janburse@fastmail.fm> - 2024-03-13 14:06 +0100

csiph-web