Skip to content

Commit f2b8c7a

Browse files
docs: blob and url ts polyfill (#729)
* docs: blob and url ts polyfill Signed-off-by: David Dal Busco <david.dalbusco@outlook.com> * 📄 Update LLMs.txt snapshot for PR review --------- Signed-off-by: David Dal Busco <david.dalbusco@outlook.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 0a0df85 commit f2b8c7a

2 files changed

Lines changed: 53 additions & 14 deletions

File tree

.llms-snapshots/llms-full.txt

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13000,15 +13000,13 @@ The TypeScript runtime used in Juno does not provide full Node.js support. Polyf
1300013000

1300113001
If you require a specific Node.js feature or are blocked by a missing polyfill, please reach out or open an issue. Features are prioritized based on usage and compatibility.
1300213002

13003-
---
13004-
13005-
## Globals
13003+
The following globals are available out of the box, without any imports.
1300613004

13007-
Some global functions are supported but come with important limitations or added details.
13005+
---
1300813006

13009-
### Math.random
13007+
## Math.random
1301013008

13011-
Generates a pseudo-random number between 0 (inclusive) and 1 (exclusive) is supported.
13009+
Generates a pseudo-random number between 0 (inclusive) and 1 (exclusive).
1301213010

1301313011
However, the generator is seeded once after upgrade of the Satellite. Use it with caution.
1301413012

@@ -13022,14 +13020,34 @@ const value = Math.random();
1302213020

1302313021
---
1302413022

13025-
### Console
13023+
## Console
1302613024

1302713025
Logging is fully supported. Objects are stringified and logs are routed to the IC-CDK `print()` function, making them visible in your Satellite logs including inside the Juno Console UI in development or production.
1302813026

1302913027
```
1303013028
console.log("Hello from the Satellite");console.info("Hello", { type: "info", msg: "Something happened" });
1303113029
```
1303213030

13031+
---
13032+
13033+
## Blob
13034+
13035+
`Blob` represents immutable raw binary data.
13036+
13037+
```
13038+
const blob = new Blob(["Hello from the Satellite"], { type: "text/plain" });const text = await blob.text();
13039+
```
13040+
13041+
---
13042+
13043+
## URL
13044+
13045+
Parses and manipulates URLs with `URL` and `URLSearchParams`.
13046+
13047+
```
13048+
const url = new URL("https://example.com?foo=bar");console.log(url.hostname); // example.comconsole.log(url.searchParams.get("foo")); // bar
13049+
```
13050+
1303313051
# Schema Types
1303413052

1303513053
Juno provides a type system built on top of [Zod](https://zod.dev/), extended with a few additional types you'll need when working with serverless functions.

docs/reference/functions/typescript/node.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ The TypeScript runtime used in Juno does not provide full Node.js support. Polyf
44

55
If you require a specific Node.js feature or are blocked by a missing polyfill, please reach out or open an issue. Features are prioritized based on usage and compatibility.
66

7-
---
8-
9-
## Globals
7+
The following globals are available out of the box, without any imports.
108

11-
Some global functions are supported but come with important limitations or added details.
9+
---
1210

13-
### Math.random
11+
## Math.random
1412

15-
Generates a pseudo-random number between 0 (inclusive) and 1 (exclusive) is supported.
13+
Generates a pseudo-random number between 0 (inclusive) and 1 (exclusive).
1614

1715
However, the generator is seeded once after upgrade of the Satellite. Use it with caution.
1816

@@ -28,11 +26,34 @@ const value = Math.random();
2826

2927
---
3028

31-
### Console
29+
## Console
3230

3331
Logging is fully supported. Objects are stringified and logs are routed to the IC-CDK `print()` function, making them visible in your Satellite logs including inside the Juno Console UI in development or production.
3432

3533
```typescript
3634
console.log("Hello from the Satellite");
3735
console.info("Hello", { type: "info", msg: "Something happened" });
3836
```
37+
38+
---
39+
40+
## Blob
41+
42+
`Blob` represents immutable raw binary data.
43+
44+
```typescript
45+
const blob = new Blob(["Hello from the Satellite"], { type: "text/plain" });
46+
const text = await blob.text();
47+
```
48+
49+
---
50+
51+
## URL
52+
53+
Parses and manipulates URLs with `URL` and `URLSearchParams`.
54+
55+
```typescript
56+
const url = new URL("https://example.com?foo=bar");
57+
console.log(url.hostname); // example.com
58+
console.log(url.searchParams.get("foo")); // bar
59+
```

0 commit comments

Comments
 (0)