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

Support fetch API #214

Open
cnuss opened this issue Dec 8, 2024 · 6 comments
Open

Support fetch API #214

cnuss opened this issue Dec 8, 2024 · 6 comments

Comments

@cnuss
Copy link

cnuss commented Dec 8, 2024

Hi there!

Could we get fetch support?

Assuming the following index.js:

(async () => {
  const response = await fetch("https://api.github.com/users/cnuss");
  const data = await response.json();
  console.log(data.url);
})();

The output of npx porffor index.js -d is:

npx porffor index.js -d
name (ByteString) | 285 (1d 01 00 00)
  value: ReferenceError (ByteString) | 6661 (00 00 00 00 00 05 ba 40)
  flags: 0b1110 0e c3
    accessor: false
    configurable: true
    enumerable: true
    writable: true

message (ByteString) | 402 (92 01 00 00)
  value: fetch is not defined (in #anonymous_0) (ByteString) | 9616 (00 00 00 00 00 c8 c2 40)
  flags: 0b1110 0e c3
    accessor: false
    configurable: true
    enumerable: true
    writable: true

constructor (ByteString) | 320 (40 01 00 00)
  value: [name]() {} (Function) | 40 (00 00 00 00 00 00 44 40)
  flags: 0b1110 0e 06
    accessor: false
    configurable: true
    enumerable: true
    writable: true

Current porffor version:

npx porffor --help
Porffor is a JavaScript/TypeScript engine/compiler/runtime. (0.50.23)
@riziles
Copy link

riziles commented Dec 9, 2024

@cnuss, stop trying to make fetch happen. It’s not going to happen.

@christiannuss-ybor
Copy link

@riziles FYI: @CanadaHonk asked for a issue to be made in the Discord

@riziles
Copy link

riziles commented Dec 9, 2024

@cnuss, wait. Have you not seen mean girls?

@christiannuss-ybor
Copy link

christiannuss-ybor commented Dec 9, 2024

Screenshot_20241208-235944

OMG that went right over my head and I will never forget mean girls again

@andriemc
Copy link

Porffor is probably not gonna have something like fetch out of the box, all it has and probably will have by default is libc apis and let libraries do the rest

@riziles
Copy link

riziles commented Dec 15, 2024

Well, crap, @christiannuss-ybor. Now I feel like an a**. I'm sorry.

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

No branches or pull requests

4 participants