Hedgehog-Computing / hedgehog-lab

Run, compile and execute JavaScript for Scientific Computing and Data Visualization TOTALLY TOTALLY TOTALLY in your BROWSER! An open source scientific computing environment for JavaScript TOTALLY in your browser, matrix operations with GPU acceleration, TeX support, data visualization and symbolic computation.
https://hlab.app
Apache License 2.0
2.36k stars 142 forks source link

added *import @username/filename #197

Closed 12-plus-1 closed 2 years ago

12-plus-1 commented 2 years ago
  1. added *import @username/filename function to preprocessor.ts. 1.1 added a file fetchApi.ts to help to achieve this function.
  2. changed some comments in preprocessor.ts. 2.1 mainly changed the subcomments of part 3.1.2 of function preprocessDFS().
  3. fixed get the current file information part of function preprocessDFS() in preprocessor.ts. (3.1.2.1.2).
AGDholo commented 2 years ago

Thanks for your PR.

We need a dynamic Api URL to provide a different development environment, it's like:

packages/hedgehog-lab/src/network/http.ts

const hostname = window.location.hostname;

let url
switch (hostname) {
    case "preview.hlab.app":
        url = "https://api.preview.hlab.app";
        break;
    case "hlab.app":
        url = "https://api.hlab.app";
        break;
    default:
        url = "http://localhost:9000";
}

But it is just a temporary solution, maybe we could create a global env to set the dynamic URL.