~bptato/chawan#11: 
Plans for XHR?

I was wondering if there is any plan to support XHR in the mid term.

I have no numbers, but I guess adding XHR support would dramatically increase the number of sites that become functional enough with Chawan.

Status
REPORTED
Submitter
~ancorgs
Assigned to
No-one
Submitted
8 months ago
Updated
3 months ago
Labels
No labels applied.

~bptato 8 months ago

I have no numbers, but I guess adding XHR support would dramatically increase the number of sites that become functional enough with Chawan.

I wonder about that ;)

But yes, it is in the todo file, and if you look closely there is even a half-implementation at src/html/xmlhttprequest.nim. I just never got around to finishing it, so it's quite useless in its current form.

(IIRC the problem I ran into back then was that our JS callback wrapper generator could not deal with XHR callbacks. Since then, I've realized that automatic callback wrapper generators are a waste of time, now I would just do it manually with JSValues.

Though I'm more interested in cleaning up fetch() first, the XHR standard builds on top of that anyway.)

~ancorgs 7 months ago

Now that we released a new version, I can confess my secret goal was to at least pass the login screen of Agama. https://yast.opensuse.org/blog/2024-05-17/agama-8

~ancorgs 3 months ago

So let's say this page renders nothing at Chawan. https://agama-online-demo.surge.sh

How can I gather logs to make sure the lack of XHR is to blame?

bptato 3 months ago · edit

~ancorgs wrote:

So let's say this page renders nothing at Chawan. https://agama-online-demo.surge.sh

How can I gather logs to make sure the lack of XHR is to blame?

It's unlikely, because we now have XHR :P

(Though it's still not 100% complete, and very sparsely tested, so I've kept this ticket open.)

Anyway, to answer your question:

  1. check if you have scripting enabled (duh)
  2. check if you have module script tags - we don't support those yet.
  3. open the page, and check the console with M-c M-c. if you see an exception, good - you've found the issue. (I think it should even show the column number, thanks to qjs-ng.)
  4. otherwise, we're stuck with the Universal Debugger...

Let me know how it goes :)

~ancorgs 3 months ago

Yes to number 2. The page includes the javascript using this tag:

<script type="module" src="./index.js"></script>

~ancorgs 3 months ago

Which leads me to the next question regarding the sentence "we don't support those yet". How far in the roadmap is that?

bptato 3 months ago · edit

~ancorgs wrote:

Which leads me to the next question regarding the sentence "we don't support those yet". How far in the roadmap is that?

Modules are in a similar state as XHR was when you opened this ticket: I've added some basic scaffolding, and got to a point where they get compiled. However, the recursive import fetching and evaluation logic is still missing.

I do hope to get it finished eventually, but again, it's relatively low priority. Patches welcome :P

Register here or Log in to comment, or comment via email.