Delivering an excellent user experience and a seamless developer experience is essential for creating high-quality modern applications. Leveraging a modern, flexible tech stack that minimizes friction for developers while maximizing performance and user satisfaction is key. The vision presented here focuses on practicality, simplicity, cohesion, and efficiency across various platforms, using technologies tailored to specific platforms and use cases across for the web, Apple platforms, Android, Windows, and games.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A reference type Set | |
private final class ReferenceSet<Element: Hashable>: Hashable, Collection { | |
typealias Element = Element | |
typealias Iterator = Set<Element>.Iterator | |
typealias Index = Set<Element>.Index | |
typealias Indices = Set<Element>.Indices | |
typealias SubSequence = Set<Element>.SubSequence | |
private var inner = Set<Element>() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createMemo, createEffect } from 'solid-js'; | |
export async function* createEffectStream<T>(fn: () => T) { | |
let promises: Promise<T>[] = []; | |
let resolve: (value: T) => void; | |
promises.push( | |
new Promise(r => { | |
resolve = r; | |
}), | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Observer { | |
execute(): void; | |
dependencies: Set<Set<Observer>>; | |
} | |
let context: Observer[] = []; | |
interface Constructor<T> { | |
new (...args: any[]): T; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import Observation | |
@Observable | |
final class Signal<T> { | |
var value: T | |
init(value: T) { | |
self.value = value | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// With Observable | |
@Observable | |
class Book { | |
var title: String | |
var author: String | |
var inStock: Bool | |
init(title: String, author: String, inStock: Bool) { | |
self.title = title |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { subject } from '@webstd/combine'; | |
import type { Publisher } from '@webstd/combine'; | |
import type { Identifiable } from '@webstd/types'; | |
import { element, ReactiveElement, html, environment } from '@webstd/custom-elements'; | |
import { Author } from './author.js' | |
class Book implements Identifiable { | |
id = crypto.randomUUID(); // A unique identifier that never changes. | |
title$ = subject('Sample Book Title'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Observable, ObservationIgnored, withObservationTracking } from '@webstd/observable'; | |
import type { Identifiable } from '@webstd/types'; | |
import { CustomElement, ReactiveElement, html, Environment, State } from '@webstd/custom-elements'; | |
import { stream } from '@webstd/request'; | |
import { Author } from './author.js' | |
@Observable | |
class Book implements Identifiable { | |
@ObservationIgnored id = crypto.randomUUID(); // A unique identifier that never changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftSignal | |
import FineGrainedViews | |
// Macro usage: | |
final class CounterViewController: UIViewController { | |
private let count = Signal(0) | |
override func viewDidLoad() { | |
super.viewDidLoad() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useSignal } from "@preact/signals" | |
import { action$, island$, json, loader$ } from "preact-server-components" | |
import { useEffect } from "preact/hooks" | |
import { db } from "./db.server" | |
const Counter = island$(() => { | |
let count = useSignal(0) | |
// TODO: Resumable hydration | |
// We don't want to do this work on the server on initial load and then again on |