aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.gitignore4
-rw-r--r--README.md157
-rw-r--r--src/bundler.zig2
-rw-r--r--src/resolver/resolver.zig3
4 files changed, 16 insertions, 150 deletions
diff --git a/.gitignore b/.gitignore
index d04a67697..9c4d76b06 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,6 +24,7 @@ src/deps/zig-clap/README.md
src/deps/zig-clap/.github
src/deps/zig-clap/.gitattributes
out
+outdir
.trace
cover
@@ -34,4 +35,5 @@ bench
github
out.*
out
-.parcel-cache \ No newline at end of file
+.parcel-cache
+esbuilddir \ No newline at end of file
diff --git a/README.md b/README.md
index 2f3c50ce9..29c198231 100644
--- a/README.md
+++ b/README.md
@@ -1,151 +1,12 @@
-# Speedy
+# TODO: write a readme
-Incredibly fast ECMAScript & TypeScript toolchain optimized for development.
+Need to cover:
+- CLI usage
+- Motivation, goals, non-goals
+- Reproducible benchmarks
+- give lots of credit to @evanw
+- say something nice about Zig
-## Motivation
-Nobody should have to wait for build tools to be productive.
-
-## Purpose
-
-The purpose of Speedy is to very quickly convert ECMAScript/TypeScript into something a web browser can execute.
-
-Goals:
-
-- Transpile fast. "Fast" is defined as "<= 3ms per un-minified file up to 1000 LOC" without a build cache
-- Transpile JSX to ECMAScript
-- Remove TypeScript annotations
-- Conditionally support React Fast Refresh
-- Rewrite CommonJS/SystemJS/UMD imports and exports to ESM
-- Support most of tsconfig.json/jsconfig.json
-- Support `defines` like in esbuild
-- Support esbuild plugins
-- Support importing CSS files from JavaScript
-- Tree-shaking
-
-Non-goals:
-
-- Bundling for production
-- Minification
-- AST plugins
-- Support Node.js
-- CommonJS, UMD, IIFE
-- ES6 to ES5
-- Supporting non-recent versions of Chromium, Firefox, or Safari. (No IE)
-
-## How it works
-
-Much of the code is a line-for-line port of esbuild to Zig. Thank you @evanw for building esbuild - a fantastic ECMAScript & CSS Bundler, and for inspiring this project.
-
-### Compatibility Table
-
-| Feature | Speedy |
-| ------------------------------------ | ------ |
-| JSX (transform) | ✅ |
-| TypeScript (transform) | ⌛ |
-| React Fast Refresh | ⌛ |
-| Hot Module Reloading | ⌛ |
-| Minification | ❌ |
-| Tree Shaking | ⌛ |
-| Incremental builds | ⌛ |
-| CSS | 🗓️ |
-| Expose CSS dependencies per file | 🗓️ |
-| CommonJS, IIFE, UMD outputs | ❌ |
-| Node.js build target | ❌ |
-| Code Splitting | ⌛ |
-| Browser build target | ⌛ |
-| Bundling for production | ❌ |
-| Support older browsers | ❌ |
-| Plugins | 🗓️ |
-| AST Plugins | ❌ |
-| Filesystem Cache API (for plugins) | 🗓️ |
-| Transform to ESM with `bundle` false | ⌛ |
-
-Key:
-
-| Tag | Meaning |
-| --- | ------------------------------------------ |
-| ✅ | Compatible |
-| ❌ | Not supported, and no plans to change that |
-| ⌛ | In-progress |
-| 🗓️ | Planned but work has not started |
-| ❓ | Unknown |
-
-### Compatibility Table (more info)
-
-| Feature | Speedy |
-| -------------------------------- | ------ |
-| `browser` in `package.json` | ⌛ |
-| main fields in `package.json` | ⌛ |
-| `exports` map in `package.json` | 🗓️ |
-| `side_effects` in `package.json` | 🗓️ |
-| `extends` in `tsconfig.json` | 🗓️ |
-
-#### Notes
-
-##### Hot Module Reloading & React Fast Refresh
-
-Speedy exposes a runtime API to support Hot Module Reloading and React Fast Refresh. React Fast Refresh depends on Hot Module Reloading to work, but you can turn either of them off. Speedy itself doesn't serve bundled files, it's up to the development server to provide that.
-
-##### Code Splitting
-
-Speedy supports code splitting the way browsers do natively: through ES Modules. This works great for local development files. It doesn't work great for node_modules or for production due to the sheer number of network requests. There are plans to make this better, stay tuned.
-
-##### Support older browsers
-
-To simplify the parser, Speedy doesn't support lowering features to non-current browsers. This means if you run a development build with Speedy with, for example, optional chaining, it won't work in Internet Explorer 11. If you want to support older browsers, use a different tool.
-
-#### Implementation Notes
-
-##### Deviations from other bundlers
-
-Unused imports are removed by default, unless they're an import without an identifier. This is similar to what the TypeScript compiler does, but TypeScript only does it for TypeScript. This is on by default, but you can turn it off.
-
-For example in this code snippet, `forEach` in unused:
-
-```ts
-import { forEach, map } from "lodash-es";
-
-const foo = map(["bar", "baz"], (item) => {});
-```
-
-So it's never included.
-
-```ts
-import { map } from "lodash-es";
-
-const foo = map(["bar", "baz"], (item) => {});
-```
-
-If
-
-##### HMR & Fast Refresh implementation
-
-This section only applies when Hot Module Reloading is enabled. When it's off, none of this part runs. React Fast Refresh depends on Hot Module Reloading.
-
-###### What is hot module reloading?
-
-HMR: "hot module reloading"
-
-A lot of developers know what it does -- but what actually is it and how does it work? Essentially, it means when a source file changes, automatically reload the code without reloading the web page.
-
-A big caveat here is JavaScript VMs don't expose an API to "unload" parts of the JavaScript context. In all HMR implementations, What really happens is this:
-
-1. Load a new copy of the code that changed
-2. Update references to the old code to point to the new code
-3. Handle errors
-
-The old code still lives there, in your browser's JavaScript VM until the page is refreshed. If any past references are kept (side effects!), undefined behavior happens. That's why, historically (by web standards), HMR has a reputation for being buggy.
-
-Loading code is easy. The hard parts are updating references and handling errors.
-
-There are two ways to update references:
-
-- Update all module imports
-- Update the exports
-
-Either approach works.
-
-###### How it's implemented in Speedy
-
-TODO: doc
+Otherwise, need to:
+- \ No newline at end of file
diff --git a/src/bundler.zig b/src/bundler.zig
index f4777c345..c2422848b 100644
--- a/src/bundler.zig
+++ b/src/bundler.zig
@@ -41,7 +41,7 @@ pub const ResolveQueue = std.fifo.LinearFifo(Resolver.Resolver.Result, std.fifo.
// 2. Look at the extension of that file path, and determine a loader
// 3. If the loader is .js, .jsx, .ts, .tsx, or .json, run it through our JavaScript Parser
// IF serving via HTTP and it's parsed without errors:
-// 4. If parsed without errors, generate a strong ETag & write the output directly to the network socket in the Printer.
+// 4. If parsed without errors, generate a strong ETag & write the output to a buffer that sends to the in the Printer.
// 7. Else, write any errors to error page
// IF writing to disk AND it's parsed without errors:
// 4. Write the output to a temporary file.
diff --git a/src/resolver/resolver.zig b/src/resolver/resolver.zig
index edf1bbb6c..abe4c2dbc 100644
--- a/src/resolver/resolver.zig
+++ b/src/resolver/resolver.zig
@@ -91,6 +91,9 @@ pub const TemporaryBuffer = struct {
pub threadlocal var TSConfigMatchFullBuf = std.mem.zeroes([512]u8);
};
+// TODO:
+// - Fix "browser" field mapping
+// - Consider removing the string list abstraction?
pub const Resolver = struct {
opts: options.BundleOptions,
fs: *Fs.FileSystem,
low=1'>Set Markdoc integration version to a minor (#8177)Gravatar Matthew Phillips 1-1/+1 2023-08-21fix(@astrojs/node): handler should work with `express` (#8176)Gravatar Emanuele Stoppa 7-16/+221 2023-08-21[docs] deprecate build.split and build.excludeMiddleware in config ref (#8158)Gravatar Sarah Rainsberger 1-25/+7 2023-08-21chore: lock fileGravatar Emanuele Stoppa 1-0/+4 2023-08-21[ci] formatGravatar natemoo-re 4-9/+15 2023-08-21Stringify shouldn't throw on user object during rendering (#8127)Gravatar Nate Moore 9-46/+115 * fix(#7923): do not throw on user { type } object * chore: remove unused type export * chore: guess it wasn't unused 2023-08-21[ci] formatGravatar natemoo-re 1-1/+4 2023-08-21fix(dev): open to base path (#8123)Gravatar Nate Moore 2-1/+8 2023-08-21chore(gitpod): resolve potential globbing and word splitting issue (#8124)Gravatar Ben Elan 1-1/+1 Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> 2023-08-21fix(#6965): fix build stats (#8122)Gravatar Nate Moore 2-1/+8 2023-08-21only update our own history entires during back navigation through view ↵Gravatar Martin Trapp 2-3/+11 transitions (#8116) 2023-08-21fix: reinsert attribute to specify direction of ViewTransition (forward / ↵Gravatar Martin Trapp 2-7/+12 back) (#8109) 2023-08-21Remove deprecated APIs (#8170)Gravatar Bjorn Lu 4-107/+5 2023-08-21Remove pre-shiki v0.14 theme names (#8169)Gravatar Bjorn Lu 6-80/+14 2023-08-21[docs] JSX framework integration READMEs (#8151)Gravatar Sarah Rainsberger 3-0/+104 2023-08-21fix(assets): Add missing type for imageConfig export (#8171)Gravatar Erika 2-1/+7 2023-08-21Deprecate simple objects from endpoints (#8132)Gravatar Bjorn Lu 20-201/+243 2023-08-18[docs] update scopedStyleStragegy default and description (#8148)Gravatar Sarah Rainsberger 1-2/+2 2023-08-18[ci] release (#8145)astro@2.10.12@astrojs/react@2.3.2@astrojs/node@5.3.5Gravatar Houston (Bot) 46-92/+98 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> 2023-08-18Fix missing package file regression (#8149)Gravatar Matthew Phillips 2-1/+7 2023-08-18fix(node): delegate preview's not found and error handling to core/app (#8141)Gravatar Arsh 2-9/+6 * fix(node): delegate preview's not found and error handling to core/app * add changeset --------- Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> 2023-08-18Replace `class:list` implementation with `clsx` (#8142)Gravatar Nate Moore 12-68/+133 * chore: replace `class:list` implementation with `clsx` * chore: remove Set support from `class:list` test * chore: better class:list test * Update packages/astro/src/runtime/server/render/component.ts 2023-08-18[ci] formatGravatar matthewp 1-1/+4 2023-08-18fix(data collections): normalize file paths for DataEntry.id (#8144)Gravatar Arsh 2-1/+6 * normalize file paths for DataEntry.id * add changeset 2023-08-18[ci] release (beta) (#8140)astro@3.0.0-beta.4Gravatar Houston (Bot) 41-65/+72 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> 2023-08-18[error messages] Update image errors-data.ts (#8126)Gravatar Sarah Rainsberger 1-12/+12 Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> 2023-08-18fix(polyfills): Use object shape for Stackblitz polyfill listGravatar Princesseuh 1-2/+2 2023-08-18fix: polyfill File using undici instead of node:buffer (#8139)Gravatar Erika 2-8/+9 * fix: polyfill File using undici instead of node:buffer * chore: changeset 2023-08-18[ci] release (beta) (#8073)create-astro@4.0.0-beta.1astro@3.0.0-beta.3@astrojs/vercel@4.0.0-beta.3@astrojs/telemetry@3.0.0-beta.2@astrojs/svelte@4.0.0-beta.1@astrojs/solid-js@3.0.0-beta.2@astrojs/react@3.0.0-beta.3@astrojs/mdx@1.0.0-beta.1@astrojs/cloudflare@7.0.0-beta.2Gravatar Houston (Bot) 63-117/+389 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> 2023-08-18[ci] release (#8138)astro@2.10.11@astrojs/react@2.3.1Gravatar Houston (Bot) 44-80/+82 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> 2023-08-18[ci] formatGravatar natemoo-re 1-1/+1 2023-08-18Fix 404 response leading to an infinite loop when there is no 404 page (#8136)Gravatar André Alves 2-1/+10 * fix: 404 response leads to infinite loop * chore: changeset --------- Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> 2023-08-18fix(react): add missing export (#8137)Gravatar Nate Moore 2-1/+7 2023-08-18[ci] release (#8096)create-astro@3.2.2astro@2.10.10@astrojs/vercel@3.8.2@astrojs/svelte@3.1.1@astrojs/solid-js@2.2.1@astrojs/react@2.3.0Gravatar Houston (Bot) 63-197/+186 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> 2023-08-18changeset(next): inlineStylesheets default switch is major (#8133)Gravatar Arsh 1-1/+1 2023-08-18feat: add polyfills for stackblitz (#8130)Gravatar Erika 7-6/+86 * feat: add polyfills for Stackblitz * chore: changeset