denoland / denoland/eszip

eszip 2.2

Open
#160 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
286
Forks
30
PR merge metrics
No merged PRs in 30d

Description

We need to be able to store the raw untranspiled bytes of TypeScript in eszip. For example:

```ts
import bytes from "./mod.ts" with { type: "bytes" }; // raw file bytes
import * as mod from "./mod.ts" // js source stored in eszip
```

Luca's suggestion (something along these lines):

```ts
Entry (module with raw source):
| Source offset (4) | Source size (4) | Raw source offset (4) | Raw source size (4) | SourceMap offset (4) | SourceMap size (4) | Module type (1) |

Entry (module with identical raw source):
| Source offset (4) | Source size (4) | SourceMap offset (4) | SourceMap size (4) | Module type (1) |
```

Then we never emit `Entry (module)` anymore.

Edit: Nevermind. Need to rethink for this scenario:

```
import json from "https://deno.land/file.json" with { type: "json" }; // json
import data from "https://deno.land/file.json" with { type: "bytes" }; // some ts file source
import mod from "https://deno.land/file.json"; // some ts file that gets transpiled
```

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or entry points are named. Start by reviewing the current eszip entry format and serialization implementation, then define how JSON, raw bytes, and transpiled source coexist in the format. Done means the revised design handles all three import cases without losing the required source representations.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.