Giter VIP home page Giter VIP logo

sable's Issues

suggestion: `fetch` API

We need to have some way of interacting with the web. If we implement this, we should get a huge boost in the amount of modules we can run. We should take a lot of inspiration from Deno here.

Tracking issue for Web APIs

I'll break this down into three categories. These are only stable APIs (according to the MDN definition of stable). I'll open a seperate issue for unstable APIs that might be nice to have in sable.

We have it

We kind of have it (partial support)

We want it

We don't want it

`bueno fmt` subcommand

We need an opinionated formatter to make bueno both usable and to follow through with it's vision.

Timers are not always fired when registered in a microtask

setTimeout(() => {
  queueMicrotask(() => {
    setTimeout(() => {
      console.log("should be called but isn't");
    }, 0);
  });
}, 0);

If there are no registered timers after a timer callback is finished running, but microtasks are enqueued that will register timers, those timers will not run. Or at least not until the next time a timer is registered.

This is caused by the fact that op_timers_sleep is called immediately after the timer callback runs, and it sees there are no timers in the queue, so it returns null immediately. However, since it's an async op, the code after the await will run after the currently scheduled microtasks, which can register new timers. And this isn't being taken into account.

Panics when importing URLs with no file extension

Importing a URL with no file extension (e.g. https://esm.sh/whatwg-fetch) results in the following error:

thread 'main' panicked at 'Failed extracting file extension: ()', bueno/loader.rs:46:26
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This is due to bueno/loader.rs checking for the file extension on both file imports and HTTP imports. This can be resolved by checking for a protocol in front of the import path (e.g. http, https, file://, or (); no protocol so default to file://, etc). This will allow us to check whether or not there's a Content-Type, which would allow for extensionless imports and therefore allow imports without explicit file extensions.

Filesystem APIs Ticket

One of the core sets of APIs that must be available for Bueno to be useable are the file system APIs. This issue tracks all of the filesystem APIs we're missing.

  • readFile - async read file and return uint8array
  • readFileSync - sync version of above
  • readTextFile - async read text file and return uint8array
  • readTextFileSync - sync version of above
  • writeFile - async write file form uint8array
  • writeFileSync - sync version of above
  • writeTextFile - async write text file form uint8array
  • writeTextFileSync - sync version of above

We'll edit this list as we complete some. We need to discuss our file API. How should we design it? What will our Bueno.fs.File class (?) look like?

Tracking issue for `Sable.` API's

Currently planned API's:

this list should be expanded upon on the fly

Sable.

  • fs
    • readFile – read file and return Uint8Array
    • readTextFile – read file and return string
    • writeFile – write file using Uint8Array
    • writeTextFile – write file using string
    • removeFile - delete file
    • removeDirectory - delete directory
    • copyFile - copy file
    • copyDirectory - copy directory
    • moveFile - move/rename file
    • moveDirectory - move/rename directory
    • makeDirectory - create a new directory
    • makeFile - create a new file
    • makeTempDirectory - create a new temporary directory in /tmp
    • makeTempFile - create a new temp file in /tmp
    • watch - create iterable which yields changes in file system
  • io
    • read – read from resource id into given Uint8Array
    • write – async write to resource id using Uint8Array
    • stdin – interface for working with standard input
    • stdout – interface for working with standard output
    • stderr – interface for working with standard error output
  • testing
    • test - test runner
    • bench - benchmark runner

Tracking issue for UNSTABLE Web APIs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.