Comments (5)
Once web streams land in spiderfire, I'd be interested in seeing fetch implemented.
from spiderfire.
How do importing other files currently work in spiderfire?
I propose a syntax like
let request = http.get("https://my.dopeapi.dev/get", {"headers": {"Authorization": "my_token"}});
console.log(request.response);
and we could also implement an HTTP handler for more efficient handling of multiple http requests
let handler = http.newHandler();
handler.get(...);
handler.delete(...);
I'd also recommend the ureq crate -- https://lib.rs/ureq
from spiderfire.
Importing is currently along the lines of
import fs from "fs";
import {get} from "./http.js";
Both of those methods (directly sending a request) and creating a request handler/agent to request without passing the options every time are planned.
I was planning to use hyper
, but I can definitely take a look at ureq
. My main issue with ureq
is probably the lack of an asynchronous API.
from spiderfire.
Looking forward for this to early try for Nitro (unjs/nitro#1781) and Nuxt!
from spiderfire.
To be precise, there's already a basic implementation of fetch
, mostly in favour of a http client module. The main caveat being it doesn't support streams.
You can see roughly what's supported here: fetch.d.ts
from spiderfire.
Related Issues (20)
- JavaScript API Documentation
- URLSearchParams in URL Module HOT 1
- TextDecoder and TextEncoder APIs HOT 1
- Improve Console Implementation HOT 1
- Dropping a context segfaults when native async functions have run HOT 10
- Is it possible to create child classes via #[js_class]? HOT 6
- Looping over response headers with `for... of` results in a segfault HOT 2
- Error when Values are concurrently rooted HOT 37
- Adding Docker build step to Spiderfire.
- Macro parsing succeeds on invalid input HOT 4
- Race condition in the event loop? HOT 8
- Native inheritance/prototype chaining is not working correctly HOT 1
- Panic when printing a prototype HOT 1
- Using clearInterval from inside the setInterval callback does not clear the interval
- Converting an object with a bad toString implementation to a string crashes SpiderFire HOT 1
- Objects with getters that fail do not trigger an error HOT 1
- Strings with invalid UTF-16 codepoints cause SpiderFire to crash HOT 1
- Opt<T> does not respect passing undefined explicitly HOT 4
- get_private and get_mut_private don't work with subclasses HOT 2
- The event loop doesn't play nice with other async code
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spiderfire.