profile
viewpoint
Jed Fox j-f1 Brown University (CS ‘23) Upstate NY https://jedfox.com 🗣 he/him

bradzacher/eslint-plugin-typescript 342

TypeScript plugin for ESLint

Charcoal-SE/coal 4

Access Charcoal HQ from a desktop app

j-f1/DOMKit 4

Access the DOM from Swift! (Very much a WIP)

ArtOfCode-/nails 3

Better-than-expected Rails clone in Node

j-f1/eslint-docs 3

Keep your rule names and descriptions up-to-date across your repo

j-f1/applifi 1

A web app to copy Spotify playlists to your Apple Music account.

j-f1/build-it 1

Build your apps (currently webpack only)

j-f1/cli-diff 1

A diff utility with highlighted output for CLIs

j-f1/aamoji-resurrected 0

⚡ Automatically install keyboard shortcuts to type emoji faster ⚡

j-f1/BDH-website 0

The new BDH website, written in Django with an updated design.

Pull request review commentswiftwasm/JavaScriptKit

Add a helper method to copy an array of numbers to a JS TypedArray

 export class SwiftRuntime {               const constructor = this.heap.referenceHeap(constructor_ref)               return obj instanceof constructor             },+            swjs_create_typed_array: (+                kind: JavaScriptTypedArrayKind,+                elementsPtr: pointer, length: number,+                result_obj: pointer+            ) => {+                const ArrayType: TypedArray = this.heap.referenceHeap(0)[JavaScriptTypedArrayKind[kind] + 'Array']

I created a globalVariable variable as a replacement. Is that a good name or should I go with something else?

j-f1

comment created time in 4 hours

issue commentgenmon/aboutfeeds

Feature: Frictionless onboarding

NetNewsWire on the Mac is able to register itself as the default feed reader so clicking on a link to an RSS feed (at least in Safari) will automatically open it in the app.

genmon

comment created time in 6 hours

push eventj-f1/forked-aboutfeeds

Jed Fox

commit sha ba0949206407ace43c85c17325c2bf0b179692fe

Update index.md

view details

push time in 8 hours

PR opened genmon/aboutfeeds

Add example RSS icons
+25 -1

0 comment

3 changed files

pr created time in 8 hours

push eventj-f1/forked-aboutfeeds

Jed Fox

commit sha e4cc3156ba5f812d82969df9dcadcd38a083df4c

Run SVGO on the icons

view details

push time in 8 hours

push eventj-f1/forked-aboutfeeds

Jed Fox

commit sha edfc8deff3df01efbf498a9b92f1961a531d1e09

Add example RSS icons

view details

push time in 8 hours

push eventj-f1/forked-aboutfeeds

Jed Fox

commit sha 0f1e4bea086fc9535f0d77d4959a73467c54574f

Add icons

view details

push time in 8 hours

create barnchj-f1/forked-aboutfeeds

branch : show-icons

created branch time in 8 hours

PR opened genmon/aboutfeeds

Add Reeder
+1 -0

0 comment

1 changed file

pr created time in 9 hours

push eventj-f1/forked-aboutfeeds

Jed Fox

commit sha 902a64cef6e3560edb4d410ac46a76eca9dba838

Add Reeder

view details

push time in 9 hours

PR opened genmon/aboutfeeds

Mention automatic feed discovery support

This is a little wordy and may be unclear so I’d really appreciate any help you can give for tightening it up!

At least Feedly, and probably other newsreader apps too, support scraping an HTML page to find <link> meta tags that tell them where to find an RSS feed. Even if a WordPress blog uses a theme that doesn’t have a visible link to the feed, those meta tags will often still be present and functional.

+2 -0

0 comment

1 changed file

pr created time in 9 hours

push eventj-f1/aboutfeeds

Jed Fox

commit sha 59f2152cd8cf84e3fdd9424146fa936656e4951b

Mention automatic feed discovery support

view details

push time in 9 hours

fork j-f1/aboutfeeds

Web feeds/RSS "getting started" guide for new users.

https://aboutfeeds.com

fork in 9 hours

startedgenmon/aboutfeeds

started time in 9 hours

startedromefrontend/rome

started time in 9 hours

issue openedcarson-katri/TokamakDocs

Building TokamakDocs?

I’m trying to update TokamakDocs to the latest Tokamak but I’m unable to run TokamakAutoDiff (which I’m assuming is used to update necessary files). It says “The loaded '_InternalSwiftSyntaxParser' library is from a toolchain that is not compatible with this version of SwiftSyntax“ although I’m building and running with the system Swift version from Xcode beta 4. Could you add some instructions on how to get this building?

It also looks like textDemoSource and buttonDemoSource are not defined.

created time in a day

startedsindresorhus/Pasteboard-Viewer

started time in a day

Pull request review commentswiftwasm/Tokamak

Add Tokamak DevTools extension for Chrome

+# TokamakDevTools++A description of this package.

Or alternatively, could you replace this with a description of how to install the extension in Chrome/Firefox?

carson-katri

comment created time in a day

Pull request review commentswiftwasm/Tokamak

Add Tokamak DevTools extension for Chrome

+import XCTest++import TokamakDevToolsTests++var tests = [XCTestCaseEntry]()+tests += TokamakDevToolsTests.allTests()+XCTMain(tests)

Are you planning to use tests for the devtools? If not can your remove them?

carson-katri

comment created time in 2 days

Pull request review commentswiftwasm/Tokamak

Add Tokamak DevTools extension for Chrome

+# TokamakDevTools++A description of this package.

Can this be deleted?

carson-katri

comment created time in 2 days

Pull request review commentswiftwasm/Tokamak

Add Tokamak DevTools extension for Chrome

+import JavaScriptKit+import TokamakDOM++final class Tree: ObservableObject {+  @Published var nodes: Set<Node>+  @Published var root: Node!++  func traverse() {+    for node in nodes {+      node.children = nodes.filter { $0.parent == node.id }+      if node.children?.count == 0 {+        node.children = nil+      }+    }+    root = nodes.first { $0.parent == nil }!+  }++  init() {+    let data: JSValue = JSObjectRef.global.window.object!._tokamak_debug_tree+    nodes = Set(data.array!.map {+      Node(object: $0.object!)+    })+    traverse()+    let listener = JSObjectRef.global.window.object!.addEventListener!(+      "tree-update",+      JSClosure { e in+        let changes = Set(+          e[0].object!.detail.array!+            .map { Node(object: $0.object!) }+        )+        self.nodes = changes.union(self.nodes)+        self.traverse()+        return .undefined

This is unrelated but it would be cool to add an overload to JSClosure that takes a closure with a Void return type and wraps it to return .undefined.

carson-katri

comment created time in 2 days

Pull request review commentswiftwasm/Tokamak

Add Tokamak DevTools extension for Chrome

+import JavaScriptKit+import TokamakDOM++struct ViewButtonStyle: ButtonStyle {+  func makeBody(configuration: ButtonStyleConfiguration) -> some View {+    configuration.label+  }+}++struct ViewGroup: View {+  @EnvironmentObject var inspector: NodeInspector++  let node: Node+  var color: Color {+    node.isPrimitive ? .primary : .blue+  }++  var weight: Font.Weight {+    node.isPrimitive ? .regular : .heavy+  }++  var label: some View {+    Button(node.typeName) { inspector.activeNode = node }+      .buttonStyle(ViewButtonStyle())+      .foregroundColor(color)+      .font(.system(size: 13, weight: weight, design: .monospaced))+      .onHover {+        if let target = node.target {+          if $0 {

Can you give this a clearer name or is $0 the convention here?

          if isHovered {
carson-katri

comment created time in 2 days

issue openedswiftwasm/Tokamak

Crash after clicking the button in the DOM reference demo

Steps to reproduce:

  1. Open the demo
  2. Select “DOM Reference“
  3. Click the button, so it changes its text
  4. Select “Counter”

Safari Technology Preview Release 110 (Safari 14.0, WebKit 15610.1.21.0.2) and Chrome 84.0.4147.105 (Official Build) (64-bit)

See the error message below:

<details>

[Error] NotFoundError: The object can not be found here.
	removeChild
	swjs_call_function_with_this (index.js:262)
	wasm-stub
	<?>.wasm-function[$s13JavaScriptKit13JSFunctionRefC5apply4this12argumentListAA7JSValueOAA08JSObjectE0C_SayAA0J11Convertible_pGtFSo03RawJ0aSayANGXEfU_ANSRyANGXEfU_]
	<?>.wasm-function[$s13JavaScriptKit13JSFunctionRefC5apply4this12argumentListAA7JSValueOAA08JSObjectE0C_SayAA0J11Convertible_pGtFSo03RawJ0aSayANGXEfU_ANSRyANGXEfU_TA]
	<?>.wasm-function[$sSRySo10RawJSValueaGABs5Error_pIgydzo_AcBsAD_pIegyrzo_TR]
	<?>.wasm-function[$sSRySo10RawJSValueaGABs5Error_pIgydzo_AcBsAD_pIegyrzo_TRTA]
	<?>.wasm-function[$sSa23withUnsafeBufferPointeryqd__qd__SRyxGKXEKlF]
	<?>.wasm-function[$s13JavaScriptKit13JSFunctionRefC5apply4this12argumentListAA7JSValueOAA08JSObjectE0C_SayAA0J11Convertible_pGtFSo03RawJ0aSayANGXEfU_]
	<?>.wasm-function[$s13JavaScriptKit13JSFunctionRefC5apply4this12argumentListAA7JSValueOAA08JSObjectE0C_SayAA0J11Convertible_pGtFSo03RawJ0aSayANGXEfU_TA]
	<?>.wasm-function[$sSaySo10RawJSValueaGABIggd_AcBIeggr_TR]
	<?>.wasm-function[$sSaySo10RawJSValueaGABIggd_AcBIeggr_TRTA.1]
	<?>.wasm-function[$sSa13JavaScriptKitAA18JSValueConvertible_pRszlE15withRawJSValuesyqd__qd__SaySo0gD0aGXElF01_fgH0L_yqd0__SayAaB_pG_SiAFzqd0__AFXEtAaB_pRszr___lF]
	<?>.wasm-function[$sSa13JavaScriptKitAA18JSValueConvertible_pRszlE15withRawJSValuesyqd__qd__SaySo0gD0aGXElF01_fgH0L_yqd0__SayAaB_pG_SiAFzqd0__AFXEtAaB_pRszr___lFqd0__AEXEfU_]
	<?>.wasm-function[$sSa13JavaScriptKitAA18JSValueConvertible_pRszlE15withRawJSValuesyqd__qd__SaySo0gD0aGXElF01_fgH0L_yqd0__SayAaB_pG_SiAFzqd0__AFXEtAaB_pRszr___lFqd0__AEXEfU_TA]
	<?>.wasm-function[$s13JavaScriptKit7JSValueO07withRawD0yxxSo0fD0aXElF]
	<?>.wasm-function[$sSa13JavaScriptKitAA18JSValueConvertible_pRszlE15withRawJSValuesyqd__qd__SaySo0gD0aGXElF01_fgH0L_yqd0__SayAaB_pG_SiAFzqd0__AFXEtAaB_pRszr___lF]
	<?>.wasm-function[$sSa13JavaScriptKitAA18JSValueConvertible_pRszlE15withRawJSValuesyqd__qd__SaySo0gD0aGXElF]
	<?>.wasm-function[$s13JavaScriptKit13JSFunctionRefC5apply4this12argumentListAA7JSValueOAA08JSObjectE0C_SayAA0J11Convertible_pGtF]
	<?>.wasm-function[$s13JavaScriptKit11JSObjectRefC13dynamicMemberAA7JSValueOAA0H11Convertible_pd_tcSgSS_tcigAfaG_pd_tcfU_]
	<?>.wasm-function[$s13JavaScriptKit11JSObjectRefC13dynamicMemberAA7JSValueOAA0H11Convertible_pd_tcSgSS_tcigAfaG_pd_tcfU_TA]
	<?>.wasm-function[$s10TokamakDOM11DOMRendererC7unmount6target4from4with10completionyAA7DOMNodeC_AJ0A4Core15MountedHostViewCyACGyyctF]
	<?>.wasm-function[$s10TokamakDOM11DOMRendererC0A4Core8RendererAadEP7unmount6target4from4with10completiony10TargetTypeQz_AmD15MountedHostViewCyxGyyctFTW]
	<?>.wasm-function[$s11TokamakCore15MountedHostViewC7unmount4withyAA15StackReconcilerCyxG_tF]
	<?>.wasm-function[$s11TokamakCore15MountedHostViewC7unmount4withyAA15StackReconcilerCyxG_tFyycfU_yAA0C7ElementCyxGXEfU_]
	<?>.wasm-function[$s11TokamakCore15MountedHostViewC7unmount4withyAA15StackReconcilerCyxG_tFyycfU_yAA0C7ElementCyxGXEfU_TA]
	<?>.wasm-function[$s11TokamakCore14MountedElementCyxGs5Error_pIggzo_ADsAE_pIegnzo_AA8RendererRzlTR]
	<?>.wasm-function[$s11TokamakCore14MountedElementCyxGs5Error_pIggzo_ADsAE_pIegnzo_AA8RendererRzlTRTA.29]
	<?>.wasm-function[$sSTsE7forEachyyy7ElementQzKXEKF]
	<?>.wasm-function[$s11TokamakCore15MountedHostViewC7unmount4withyAA15StackReconcilerCyxG_tFyycfU_]
	<?>.wasm-function[$s11TokamakCore15MountedHostViewC7unmount4withyAA15StackReconcilerCyxG_tFyycfU_TA]
	<?>.wasm-function[$s10TokamakDOM11DOMRendererC7unmount6target4from4with10completionyAA7DOMNodeC_AJ0A4Core15MountedHostViewCyACGyyctF6$deferL_yyF]
	<?>.wasm-function[$s10TokamakDOM11DOMRendererC7unmount6target4from4with10completionyAA7DOMNodeC_AJ0A4Core15MountedHostViewCyACGyyctF]
	<?>.wasm-function[$s10TokamakDOM11DOMRendererC0A4Core8RendererAadEP7unmount6target4from4with10completiony10TargetTypeQz_AmD15MountedHostViewCyxGyyctFTW]
	<?>.wasm-function[$s11TokamakCore15MountedHostViewC7unmount4withyAA15StackReconcilerCyxG_tF]
	<?>.wasm-function[$s11TokamakCore20MountedCompositeViewC7unmount4withyAA15StackReconcilerCyxG_tFyAA0C7ElementCyxGXEfU_]
	<?>.wasm-function[$s11TokamakCore20MountedCompositeViewC7unmount4withyAA15StackReconcilerCyxG_tFyAA0C7ElementCyxGXEfU_TA]
	<?>.wasm-function[$s11TokamakCore14MountedElementCyxGs5Error_pIggzo_ADsAE_pIegnzo_AA8RendererRzlTR]
	<?>.wasm-function[$s11TokamakCore14MountedElementCyxGs5Error_pIggzo_ADsAE_pIegnzo_AA8RendererRzlTRTA]
	<?>.wasm-function[$sSTsE7forEachyyy7ElementQzKXEKF]
	<?>.wasm-function[$s11TokamakCore20MountedCompositeViewC7unmount4withyAA15StackReconcilerCyxG_tF]
	<?>.wasm-function[$s11TokamakCore20MountedCompositeViewC7unmount4withyAA15StackReconcilerCyxG_tFyAA0C7ElementCyxGXEfU_]
	<?>.wasm-function[$s11TokamakCore20MountedCompositeViewC7unmount4withyAA15StackReconcilerCyxG_tFyAA0C7ElementCyxGXEfU_TA]
	<?>.wasm-function[$s11TokamakCore14MountedElementCyxGs5Error_pIggzo_ADsAE_pIegnzo_AA8RendererRzlTR]
	<?>.wasm-function[$s11TokamakCore14MountedElementCyxGs5Error_pIggzo_ADsAE_pIegnzo_AA8RendererRzlTRTA]
	<?>.wasm-function[$sSTsE7forEachyyy7ElementQzKXEKF]
	<?>.wasm-function[$s11TokamakCore20MountedCompositeViewC7unmount4withyAA15StackReconcilerCyxG_tF]
	<?>.wasm-function[$s11TokamakCore20MountedCompositeViewC7unmount4withyAA15StackReconcilerCyxG_tFyAA0C7ElementCyxGXEfU_]
	<?>.wasm-function[$s11TokamakCore20MountedCompositeViewC7unmount4withyAA15StackReconcilerCyxG_tFyAA0C7ElementCyxGXEfU_TA]
	<?>.wasm-function[$s11TokamakCore14MountedElementCyxGs5Error_pIggzo_ADsAE_pIegnzo_AA8RendererRzlTR]
	<?>.wasm-function[$s11TokamakCore14MountedElementCyxGs5Error_pIggzo_ADsAE_pIegnzo_AA8RendererRzlTRTA]
	<?>.wasm-function[$sSTsE7forEachyyy7ElementQzKXEKF]
	<?>.wasm-function[$s11TokamakCore20MountedCompositeViewC7unmount4withyAA15StackReconcilerCyxG_tF]
	<?>.wasm-function[$s11TokamakCore20MountedCompositeViewC7unmount4withyAA15StackReconcilerCyxG_tFyAA0C7ElementCyxGXEfU_]
	<?>.wasm-function[$s11TokamakCore20MountedCompositeViewC7unmount4withyAA15StackReconcilerCyxG_tFyAA0C7ElementCyxGXEfU_TA]
	<?>.wasm-function[$s11TokamakCore14MountedElementCyxGs5Error_pIggzo_ADsAE_pIegnzo_AA8RendererRzlTR]
	<?>.wasm-function[$s11TokamakCore14MountedElementCyxGs5Error_pIggzo_ADsAE_pIegnzo_AA8RendererRzlTRTA]
	<?>.wasm-function[$sSTsE7forEachyyy7ElementQzKXEKF]
	<?>.wasm-function[$s11TokamakCore20MountedCompositeViewC7unmount4withyAA15StackReconcilerCyxG_tF]
	<?>.wasm-function[$s11TokamakCore15StackReconcilerC9reconcile_4with14getElementType11updateChild05mountK0yAA016MountedCompositeH0CyxG_qd__ypXpqd__XEyAA0mH0CyxGXEANqd__XEtlF]
	<?>.wasm-function[$s11TokamakCore20MountedCompositeViewC6update4withyAA15StackReconcilerCyxG_tF]
	<?>.wasm-function[$s11TokamakCore15MountedHostViewC6update4withyAA15StackReconcilerCyxG_tF]
	<?>.wasm-function[$s11TokamakCore15MountedHostViewC6update4withyAA15StackReconcilerCyxG_tF]
	<?>.wasm-function[$s11TokamakCore15MountedHostViewC6update4withyAA15StackReconcilerCyxG_tF]
	<?>.wasm-function[$s11TokamakCore15StackReconcilerC9reconcile_4with14getElementType11updateChild05mountK0yAA016MountedCompositeH0CyxG_qd__ypXpqd__XEyAA0mH0CyxGXEANqd__XEtlF]
	<?>.wasm-function[$s11TokamakCore20MountedCompositeViewC6update4withyAA15StackReconcilerCyxG_tF]
	<?>.wasm-function[$s11TokamakCore15StackReconcilerC23updateStateAndReconcile33_FCAA3CDB23B668BF64A31B25B678943FLLyyF]
	<?>.wasm-function[$s11TokamakCore15StackReconcilerC11queueUpdate33_FCAA3CDB23B668BF64A31B25B678943FLL3foryAA23MountedCompositeElementCyxG_tFyycfU_]
	<?>.wasm-function[$s11TokamakCore15StackReconcilerC11queueUpdate33_FCAA3CDB23B668BF64A31B25B678943FLL3foryAA23MountedCompositeElementCyxG_tFyycfU_TA]
	<?>.wasm-function[$s10TokamakDOM16timeoutScheduler33_F13EEBBBBF12A8FD2FFB333EE440B10ELLyyyyccvpfiyyyccfU_13JavaScriptKit7JSValueOSayAFGcfU_]
	<?>.wasm-function[$s10TokamakDOM16timeoutScheduler33_F13EEBBBBF12A8FD2FFB333EE440B10ELLyyyyccvpfiyyyccfU_13JavaScriptKit7JSValueOSayAFGcfU_TA]
	<?>.wasm-function[$sSay13JavaScriptKit7JSValueOGACIeggo_AdCIegnr_TR]
	<?>.wasm-function[$sSay13JavaScriptKit7JSValueOGACIeggo_AdCIegnr_TRTA]
	<?>.wasm-function[$sSay13JavaScriptKit7JSValueOGACIegnr_AdCIeggo_TR]
	<?>.wasm-function[$sSay13JavaScriptKit7JSValueOGACIegnr_AdCIeggo_TRTA]
	<?>.wasm-function[$s13JavaScriptKit19_call_host_functionyys6UInt32V_SPySo10RawJSValueaGs5Int32VADtF]
	<?>.wasm-function[swjs_call_host_function]
	wasm-stub
	swjs_call_host_function
	callHostFunction (index.js:97)

created time in 2 days

pull request commentswiftwasm/Tokamak

Add default dark styles for Views

Two issues in this branch in Safari that I can’t reproduce on main:

  • clicking the counter until it should show “Limit Exceeded” instead throws an error
  • clicking the button in the DOM Reference demo does nothing or briefly shows the changed text before reverting
carson-katri

comment created time in 3 days

push eventj-f1/vercel-tl-feed

Jed Fox

commit sha fe8ddbe2e90454816f1359b0a2cbe33d1ec1d760

Adapt tl-feed for Vercel

view details

push time in 3 days

fork j-f1/tl-feed

tinyletter ⇉ rss feed

fork in 3 days

delete branch j-f1/forked-JavaScriptKit

delete branch : no-jsobject-methods

delete time in 3 days

startedjlengstorf/eslint-plugin-replyguy

started time in 3 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha f655aabae96fce7c931370fa27c89d88ee2f8bcb

args → arguments

view details

Jed Fox

commit sha 3881e64bc7c99313073fb4ad06402dbdfbece228

Mark callAsFunction(this:, arguments:) as public

view details

push time in 3 days

Pull request review commentestree/estree

added await.ops

+# [Await.ops](https://github.com/tc39/proposal-await.ops)++## AwaitExpression++```js+interface AwaitExpression <: Expression {+    type: "AwaitExpression";+    argument: Expression;+    operation: "all" | "any" | "race" | "allSettled" | undefined

To allow easy extensibility, should this be an Identifier | null so future additions won’t have to change the AST or does it make sense to strictly limit the allowed operations?

anikethsaha

comment created time in 3 days

pull request commentswiftwasm/Tokamak

Add default dark styles for Views

Pointer events are supported in Safari 13. It looks like there’s a version 2 of the spec which is why the old one is obsolete.

carson-katri

comment created time in 3 days

Pull request review commentswiftwasm/JavaScriptKit

Add a helper method to copy an array of numbers to a JS TypedArray

 export class SwiftRuntime {               const constructor = this.heap.referenceHeap(constructor_ref)               return obj instanceof constructor             },+            swjs_create_typed_array: (+                kind: JavaScriptTypedArrayKind,+                elementsPtr: pointer, length: number,+                result_obj: pointer+            ) => {+                const ArrayType: TypedArray = this.heap.referenceHeap(0)[JavaScriptTypedArrayKind[kind] + 'Array']+                const array = new ArrayType(memory().buffer, elementsPtr, length);+                // Call `.slice()` to copy the memory+                writeUint32(result_obj, this.heap.allocHeap(array.slice()));

Because if we don't the Swift and JS arrays will share the memory which is not the point of the API.

j-f1

comment created time in 4 days

pull request commentswiftwasm/Tokamak

Add basic `Animation` support

Very cool! It looks like the SwiftUI versions are horizontally compressed somehow, maybe?

MaxDesiatov

comment created time in 4 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha 8a5097101520aff2e0f4de5bb737461bf5646749

Uncomment tests, fix bug

view details

push time in 4 days

pull request commentswiftwasm/JavaScriptKit

Change `JSClosure.release` to `deinit`

There’s FinalizationRegistry which is supported everywhere but Safari and allows you to probably (at the engine’s discretion) have a callback called when a given object is garbage collected. If this is available, it might be possible to combine it with WeakRefs to release the closure on the Swift side too.

MaxDesiatov

comment created time in 4 days

issue commentswiftwasm/Tokamak

PDF renderer

PDF is a pretty complex format, would rendering to HTML and then converting to PDF from that be a reasonable workaround in the meantime?

From my (limited) experience with making PDFs from HTML, the two formats are different enough that it can be hard to make things look good when converted to PDF. I think it might be worth doing it from scratch (maybe using a Swift library like TPPDF?) but this is definitely a low priority issue that can wait until the DOM tenderer is done.

j-f1

comment created time in 5 days

issue commentswiftwasm/Tokamak

PDF renderer

And it would be useful for apps that dynamically generate PDFs based on user input because they’d be able to render a preview in a fixed size box with SwiftUI or TokamakDOM then pass the same state to TokamakPDF

j-f1

comment created time in 5 days

issue openedswiftwasm/Tokamak

PDF renderer

It would be cool to have a way to render directly to a PDF, maybe with a limited set of views that match what people expect out of a PDF. This could be super useful for one-off page layouts for invitations and similar!

created time in 5 days

pull request commentswiftwasm/Tokamak

Add default dark styles for Views

I only see it happening in Safari but I also only happen to have beta versions of Safari installed right now so I can’t check the shipping version. I can try to report it though!

carson-katri

comment created time in 5 days

issue closedfreeCodeCamp/devdocs

I build a node.js version of devdocs

<!-- Please read the contributing guidelines before opening an issue: https://github.com/freeCodeCamp/devdocs/blob/master/.github/CONTRIBUTING.md

Go here to request a new documentation: https://trello.com/b/6BmTulfx/devdocs-documentation --> Hi all, i have built a Node.js version of devdocs, the address is https://liusha.io , please give it a try and tell me your thought about my project, the content is from devdocs.

closed time in 6 days

fengmao

pull request commentswiftwasm/Tokamak

Add default dark styles for Views

Now the text of the button is always black (instead of flipping to white when you mousedown) and clicking on the text no longer activates the button (you have to click on the button’s padding instead.

carson-katri

comment created time in 6 days

pull request commentswiftwasm/Tokamak

Fix color scheme observer crashes in Safari

Yeah, I’m using a local override on dev.js to run delete BigInt; before everything else.

MaxDesiatov

comment created time in 7 days

pull request commentswiftwasm/Tokamak

Fix color scheme observer crashes in Safari

It’s probably because I’m using Safari Technology Preview (Release 110, Safari 14.0, WebKit 15610.1.21.0.2).

MaxDesiatov

comment created time in 7 days

startedswiftwasm/JavaScriptKit

started time in 8 days

pull request commentswiftwasm/Tokamak

Add default dark styles for Views

I’ve got a weird behavior with SpacerDemo in Safari but it might be a rendering artifact: https://youtu.be/Q1wPio2qJGw

carson-katri

comment created time in 8 days

pull request commentswiftwasm/JavaScriptKit

Add a helper method to copy an array of numbers to a JS TypedArray

Also happy to write something that goes the other way now, though.

j-f1

comment created time in 8 days

pull request commentswiftwasm/JavaScriptKit

Add a helper method to copy an array of numbers to a JS TypedArray

I did a quick search, and it seems like a TypedArray is used as input to the Blob constructor. There’s also ways to construct TypedArrays out of the ArrayBuffer you get back from a Blob. The TypedArray stuff is separate from the main part of DOMKit, and there is no support for creating one from an ArrayBuffer yet, so we could push that feature to a future PR.

j-f1

comment created time in 8 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha 0cb3f650b4d7ec51cb13e266d24d0f5028d0b410

_copy_typed_array_content → _create_typed_array

view details

push time in 8 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha fe68a31fc5143647de4e73171283b6b01f2ca094

Add a helper method to copy an array of numbers to a JS TypedArray

view details

push time in 8 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha 296221556b4fb066906756fa03de18e9515e736e

Add a helper method to copy an array of numbers to a JS TypedArray

view details

push time in 8 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha c96b3a0aa13f28b86e68ba72d2b7bf3df7ea1386

Add a helper method to copy an array of FixedWidthIntegers to a JS TypedArray

view details

push time in 8 days

create barnchj-f1/forked-JavaScriptKit

branch : typed-array

created branch time in 8 days

push eventj-f1/forked-JavaScriptKit

Max Desiatov

commit sha 19365a10066e7d161e192d0dda5c6aa8c8387f9a

Implement `RandomAccessCollection` on `JSArrayRef` (#30) * Implement `RandomAccessCollection` on `JSArrayRef` * Remove unused `Index` typealias

view details

push time in 8 days

push eventj-f1/forked-JavaScriptKit

Manuel Burghard

commit sha 6896e3aa220ac6e82c7d1f13806f0eaf5b7515f4

Changes related to WebIDL support.

view details

Jed Fox

commit sha 0906080f2592337d644c28a57f4313d045a694e3

Rename constructor

view details

Jed Fox

commit sha 2bd91ed73ea5f486cc32199ad173ddbfdf685b92

wip

view details

Jed Fox

commit sha 751a3d7ad58a43e18faefee2f4d9f578dc6e1d01

Add helper method to copy an array of FixedWidthIntegers to a JS TypedArray

view details

Jed Fox

commit sha fca708035fac03d1910942d6cfacc8632471ce5c

Add JSAbstractBridgedType

view details

Jed Fox

commit sha 000fe5bddd8cdc06152b2915cac9a062638aed05

More updates

view details

push time in 8 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha aac7833adc1458e1471c0592f57f7a784f634ffe

Ignore .swiftpm

view details

Max Desiatov

commit sha 19365a10066e7d161e192d0dda5c6aa8c8387f9a

Implement `RandomAccessCollection` on `JSArrayRef` (#30) * Implement `RandomAccessCollection` on `JSArrayRef` * Remove unused `Index` typealias

view details

Jed Fox

commit sha 009d45172b48b4258174c517e230c1c72e845ecb

Switch back to JSFunctionRef.new()

view details

Jed Fox

commit sha 0f240c373f207b30b37b50e0f82f428a1bd7f81b

Switch instanceof to JSObjectRef.isInstanceOf

view details

Jed Fox

commit sha 774b08bf0d8826aa53ff2c736c93a56fb039e1fd

Revert "Subscript-based JSValue conversion" This reverts commit 4373e953e3ef72f71efbaf965c4caed41f7b754f.

view details

Jed Fox

commit sha 3c33a92f680cb5ba2cd2cbaa4e3fb01d0e27c378

Merge remote-tracking branch 'upstream/master' into no-jsobject-methods

view details

Jed Fox

commit sha b3574a0a5d4f6b4ee0f2c9c5a167c9d18848be52

Fix error

view details

Jed Fox

commit sha 2465f84e559ef1a75b240c34b322797e90e888fc

Run swiftformat

view details

Manuel Burghard

commit sha 0012028f5b68cc5531efa979ad853bad42ea9b00

Changes related to WebIDL support.

view details

Jed Fox

commit sha 899fe040825a3d90406abcacd92dc9970ec2c36c

Rename constructor

view details

Jed Fox

commit sha c5d74b10654553a48c41007a3351598b77750685

wip

view details

Jed Fox

commit sha 86dcd39900950cd9b45c84597a7bba01e250dc86

Add helper method to copy an array of FixedWidthIntegers to a JS TypedArray

view details

Jed Fox

commit sha e6dc9ed7a542de18f1975bdea9bd33a89f2223a4

Add JSAbstractBridgedType

view details

Jed Fox

commit sha 9b47115375e91bf0f6b0a2f1331a4569443b9346

More updates

view details

Jed Fox

commit sha ab414d78c567ad3d0ac015ac8a77ce16fb7c38b5

Make dyamicMember return a JSFunctionRef in the disfavoredOverload

view details

push time in 8 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha 2465f84e559ef1a75b240c34b322797e90e888fc

Run swiftformat

view details

push time in 8 days

push eventj-f1/forked-JavaScriptKit

Max Desiatov

commit sha 19365a10066e7d161e192d0dda5c6aa8c8387f9a

Implement `RandomAccessCollection` on `JSArrayRef` (#30) * Implement `RandomAccessCollection` on `JSArrayRef` * Remove unused `Index` typealias

view details

Jed Fox

commit sha 3c33a92f680cb5ba2cd2cbaa4e3fb01d0e27c378

Merge remote-tracking branch 'upstream/master' into no-jsobject-methods

view details

Jed Fox

commit sha b3574a0a5d4f6b4ee0f2c9c5a167c9d18848be52

Fix error

view details

push time in 8 days

pull request commentswiftwasm/JavaScriptKit

Remove all methods from JSObjects to free up the property namespace

Good point! I reverted those changes, so now the last few samples look like this:

foo.new(arg1, arg2, arg3)
new foo(arg1, arg2, arg3)

foo.new(args: [arg1, arg2, arg3])
new foo(...[arg1, arg2, arg3])

foo.new()
new foo()

Additionally, I changed the JSValue code back to using .jsValue() and changed instanceof to add the method isInstanceOf.

j-f1

comment created time in 8 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha 009d45172b48b4258174c517e230c1c72e845ecb

Switch back to JSFunctionRef.new()

view details

Jed Fox

commit sha 0f240c373f207b30b37b50e0f82f428a1bd7f81b

Switch instanceof to JSObjectRef.isInstanceOf

view details

Jed Fox

commit sha 774b08bf0d8826aa53ff2c736c93a56fb039e1fd

Revert "Subscript-based JSValue conversion" This reverts commit 4373e953e3ef72f71efbaf965c4caed41f7b754f.

view details

push time in 8 days

issue closedswiftwasm/JavaScriptKit

BigInt Support

As part of #26, I created an API that uses BigInt values in some cases. They are not currently implemented, however. An important design question is whether bey should be represented as Int64/UInt64 — sacrificing precision for code size and ease of use — or whether some sort of BigInt library should be made a dependency so we can guarantee precision at the cost of code size and performance.

closed time in 8 days

j-f1

pull request commentestree/estree

Generate markdown files automatically

I'm not the person who is going to be maintaining the specs for years to come, so if you have any suggestions for changes to the syntax, I would be happy to implement them.

j-f1

comment created time in 8 days

pull request commentswiftwasm/Tokamak

Add `GeometryReader` implementation

I got that to work after I added this CSS to GeometryReader:

display: flex;
align-items: center;
justify-content: center;

…weirdly, the text isn’t exactly centered.

MaxDesiatov

comment created time in 9 days

push eventswiftwasm/Tokamak

Jed Fox

commit sha 4595fb62d904078134f92e2c91e28549c86d1237

Make convert functions private

view details

push time in 9 days

issue commentswiftwasm/Tokamak

Dark mode detection causes crashes in Safari

I haven’t been able to reproduce this on my side but this change should help debug:

diff --git a/Sources/TokamakDOM/App/ColorSchemeObserver.swift b/Sources/TokamakDOM/App/ColorSchemeObserver.swift
index 262acba..2bfebfa 100644
--- a/Sources/TokamakDOM/App/ColorSchemeObserver.swift
+++ b/Sources/TokamakDOM/App/ColorSchemeObserver.swift
@@ -25,7 +25,12 @@ enum ColorSchemeObserver {
 
   static func observe(_ rootElement: JSObjectRef) {
     let closure = JSClosure {
-      publisher.value = .init(matchMediaDarkScheme: $0[0].object!)
+      if let matchMediaDarkScheme = $0[0].object {
+        publisher.value = .init(matchMediaDarkScheme: matchMediaDarkScheme)
+      } else {
+        print($0)
+        _ = JSObjectRef.global.console.object!.log!($0[0])
+      }
       return .undefined
     }
     _ = matchMediaDarkScheme.addEventListener!("change", closure)
MaxDesiatov

comment created time in 9 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha aac7833adc1458e1471c0592f57f7a784f634ffe

Ignore .swiftpm

view details

push time in 9 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha fee69aac047bea545b295451fe982c45361ec8f7

Make dyamicMember return a JSFunctionRef in the disfavoredOverload

view details

push time in 9 days

pull request commentswiftwasm/Tokamak

Add `GeometryReader` implementation

IMO if it's a small bug or something that prevents building it shouldn't be merged in general. But if it's more complex or harder-to-solve bug, it's ok to merge then follow up with an issue or PR.

MaxDesiatov

comment created time in 9 days

push eventswiftwasm/Tokamak

Jed Fox

commit sha 88064fd5bc1bc041eae4bc81d1ad5bad91fabed5

Split demo list into sections (#243) * Split demo list into sections * Remove slider demo * Update RedactDemo.swift * Redact → Redaction, move DOM refs to a TokamakDOM section, additional adjustments * RedactDemo → RedactionDemo

view details

push time in 9 days

delete branch swiftwasm/Tokamak

delete branch : demo-sections

delete time in 9 days

PR merged swiftwasm/Tokamak

Split demo list into sections enhancement
+96 -111

0 comment

2 changed files

j-f1

pr closed time in 9 days

issue openedswiftwasm/JavaScriptKit

BigInt Support

As part of #26, I created an API that uses BigInt values in some cases. They are not currently implemented, however. An important design question is whether bey should be represented as Int64/UInt64 — sacrificing precision for code size and ease of use — or whether some sort of BigInt library should be made a dependency so we can guarantee precision at the cost of code size and performance.

created time in 9 days

issue commentswiftwasm/JavaScriptKit

DOMKit?

While this is a start, several changes are needed for a truly great native swift DOM API. We need to be able to modify the default function signatures to change or remove parameter names. Well some named parameters would be a great addition to the usability of the DOM API, I think that most of them provide little benefit. Dude also be great to extend the DON API with methods that make use of native Swift types and best practices. For example, options that are passed as an object in JavaScript could be expanded out to named parameters in Swift. It would also be good to allow passing Swift closures as an event handler, as the current way of creating a event handler object is extremely cumbersome.

j-f1

comment created time in 9 days

issue commentswiftwasm/JavaScriptKit

DOMKit?

I’ve got DOMKit building! (haven’t tried running it yet)

https://github.com/j-f1/DOMKit

let document = DOMKit.Document(jsValue: JSObjectRef.global.document)

let button = document.createElement(localName: "button")
button.textContent = "Hello, world"

class ClickListener: EventListener {
    required init(objectRef: JSObjectRef) {
        self.objectRef = objectRef
    }

    var objectRef: JSObjectRef
    static func canDecode(from jsValue: JSValue) -> Bool { false }
    func handleEvent(event: Event) {
        (event.target as? HTMLElement)?.textContent = "Clicked!"
    }
}

let emptyObject = JSObjectRef.global.Object.function!(.new)

button.addEventListener(type: "click", callback: ClickListener(objectRef: emptyObject))
_ = document.querySelector(selectors: "body")?.appendChild(node: button)
j-f1

comment created time in 9 days

create barnchj-f1/DOMKit

branch : main

created branch time in 9 days

created repositoryj-f1/DOMKit

Access the DOM from Swift! (Very WIP)

created time in 9 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha fa1a06d9ca23e8d5ec5f840c6e515271b1f70113

More updates

view details

push time in 9 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha da7002f3ac6aab61970412f5a258a37cd565457a

Add JSAbstractBridgedType

view details

push time in 9 days

pull request commentswiftwasm/Tokamak

Add default dark styles for Views

Great to see you have selected link highlighting working!

I’ve noticed a bug in Safari: when you load the demo, click on a section in a sidebar, switch to a different tab, then come back, the content of the NavigationView permanently disappears (the sidebar remains) and clicking other navigation links has no effect.

carson-katri

comment created time in 9 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha 307f6d47bc93647473478a01a103483acae0b816

Update JSObject.swift

view details

push time in 9 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha d28e1ffff21e4b11adac238cd5fbf797c8a0288d

Support Float*Array too

view details

push time in 9 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha c6264a36f0cdb8cd4ab396dd211385c1d936144b

Formatting

view details

Jed Fox

commit sha d27954347371f18a2dbe753a4d5f89b4ad6eac15

Add helper method to copy an array of FixedWidthIntegers to a JS TypedArray

view details

push time in 9 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha 98d1026eb60ed36fa609ed6373caada67d15eb77

wip

view details

push time in 9 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha 1f1a7e43daee80e2b9317bbfaad673b9589e5985

A few tweaks

view details

push time in 9 days

issue commentswiftwasm/Tokamak

Collapse multiple modifiers into a single DOM element if possible

Since margins can collapse against each other in some circumstances I think it would be best to stick to padding. Maybe have a way to tag modifiers as either dependent on or causing a change to view metrics? Then it would be possible to combine, for example, background and border modifiers, and a wrapped padding modifier would be added to a new HTML element.

MaxDesiatov

comment created time in 9 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha 80512ba623655dd1ef5be71e0abcdd05dd4dbc39

Comment out broken code

view details

push time in 9 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha 34af077df27fddd2cdfa3022c88b9c471449da05

Add xcworkspaces

view details

Jed Fox

commit sha 671a02e2ab86c1ae305708ffe56de54167ed6071

Convert JSObjectRef.get() and JSObjectRef.set() to subscripts

view details

Jed Fox

commit sha 959379fd681666972ba53ae89ed51a63596f206d

Make instanceof static

view details

Jed Fox

commit sha c4d2e12dc251a2449deba568153262426febc69e

[not working] attempt at new JSValueConvertible with no instance methods

view details

Jed Fox

commit sha 4b70a6a5bbf4933a45cfc05f3cef37dc48ebff9e

Revert "[not working] attempt at new JSValueConvertible with no instance methods" This reverts commit c4d2e12dc251a2449deba568153262426febc69e.

view details

Jed Fox

commit sha 4373e953e3ef72f71efbaf965c4caed41f7b754f

Subscript-based JSValue conversion

view details

Jed Fox

commit sha f11fc32d2bc1c4540c53c988edd85911ea51d91e

Partially fix tests

view details

Jed Fox

commit sha 39b15f4c1a9aaaf23c5aaeee20e4640d590611d9

Remove JSFunctionRef.apply and JSFunctionRef.new

view details

Jed Fox

commit sha ec9a29a0362a5993e9b6f4008dcf17966a8b6d0c

Comment out failing tests

view details

Jed Fox

commit sha 3a4ccee93ff8830f3c4ff4d1378331bf3caf0197

Update function call signature

view details

Jed Fox

commit sha db421dbdbf7a8c314cfbb4943c86482eb7cba593

Last change to functions, hopefully

view details

Jed Fox

commit sha 922cbb54ccf04c9024a8d048df794994b6161e63

Remove unnecessary .function

view details

Manuel Burghard

commit sha 3f7bba2c8055b04f33cd71ea648c488e0e9e8eba

Changes related to WebIDL support.

view details

Jed Fox

commit sha c24c33777044913ae6620751494088ece9841ef0

Several fixes & updates

view details

Jed Fox

commit sha 4043e2b4b7bcbc0c0065b5d8e4bf8d8b6c17e8cb

Rename constructor

view details

Jed Fox

commit sha bbf990b10c374c4ea461823aaa8c2ba9fc76a8a7

Finish rename

view details

Jed Fox

commit sha f08c56c724d22264f456bd01585d5d4dd37b8e45

Make classRef required

view details

push time in 9 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha db421dbdbf7a8c314cfbb4943c86482eb7cba593

Last change to functions, hopefully

view details

Jed Fox

commit sha 922cbb54ccf04c9024a8d048df794994b6161e63

Remove unnecessary .function

view details

push time in 9 days

push eventj-f1/input-sources

Jed Fox

commit sha fe4f2a495f6091b920a434101f55d5039dbbeee1

Update README.md

view details

push time in 9 days

Pull request review commentswiftwasm/Tokamak

Split demo list into sections

 struct NavItem: Identifiable {    init(unavailable id: String) {     self.id = id+    destination = nil   }-}--var outlineGroupDemo: NavItem {-  if #available(OSX 10.16, iOS 14.0, *) {-    return NavItem("OutlineGroup", destination: OutlineGroupDemo())-  } else {-    return NavItem(unavailable: "OutlineGroup")-  }-}--#if !os(macOS)-var listDemo: AnyView {-  if #available(iOS 14.0, *) {-    return AnyView(ListDemo().listStyle(InsetGroupedListStyle()))-  } else {-    return AnyView(ListDemo())-  }-}-#else-var listDemo = ListDemo()-#endif--var sidebarDemo: NavItem {-  if #available(iOS 14.0, *) {-    return NavItem("Sidebar", destination: SidebarListDemo().listStyle(SidebarListStyle()))-  } else {-    return NavItem(unavailable: "Sidebar")-  }-}--var gridDemo: NavItem {-  if #available(OSX 10.16, iOS 14.0, *) {-    return NavItem("Grid", destination: GridDemo())-  } else {-    return NavItem(unavailable: "Grid")-  }-}--var appStorageDemo: NavItem {-  if #available(OSX 11.0, iOS 14.0, *) {-    return NavItem("AppStorage", destination: AppStorageDemo())-  } else {-    return NavItem(unavailable: "AppStorage")-  }-} -var redactDemo: NavItem {-  if #available(OSX 11.0, iOS 14.0, *) {-    return NavItem("Redact", destination: RedactDemo())-  } else {-    return NavItem(unavailable: "Redact")+  @ViewBuilder var body: some View {+    if let dest = destination {+      NavigationLink(id, destination: HStack {+        Spacer(minLength: 0)+        dest+        Spacer(minLength: 0)+      })+    } else {+      #if os(WASI)+      Text(id)+      #elseif os(macOS)+      Text(id).opacity(0.5)+      #else+      HStack {+        Text(id)+        Spacer()+        Text("unavailable").opacity(0.5)+      }+      #endif+    }   } } -var domRefDemo: NavItem {-  #if os(WASI)-  return NavItem("DOM reference", destination: DOMRefDemo())-  #else-  return NavItem(unavailable: "DOM reference")-  #endif-}--let links = [-  NavItem("Counter", destination:-    Counter(count: Count(value: 5), limit: 15)-      .padding()-      .background(Color(red: 0.9, green: 0.9, blue: 0.9, opacity: 1.0))-      .border(Color.red, width: 3)),-  NavItem("ZStack", destination: ZStack {-    Text("I'm on bottom")-    Text("I'm forced to the top")-      .zIndex(1)-    Text("I'm on top")-  }.padding(20)),-  NavItem("ButtonStyle", destination: ButtonStyleDemo()),-  NavItem("ForEach", destination: ForEachDemo()),-  NavItem("Text", destination: TextDemo()),-  NavItem("Toggle", destination: ToggleDemo()),-  NavItem("Path", destination: PathDemo()),-  NavItem("TextField", destination: TextFieldDemo()),-  NavItem("Spacer", destination: SpacerDemo()),-  NavItem("Environment", destination: EnvironmentDemo().font(.system(size: 8))),-  NavItem("Picker", destination: PickerDemo()),-  NavItem("List", destination: listDemo),-  sidebarDemo,-  outlineGroupDemo,-  NavItem("Color", destination: ColorDemo()),-  appStorageDemo,-  gridDemo,-  redactDemo,-  domRefDemo,-]- struct TokamakDemoView: View {   var body: some View {     NavigationView { () -> AnyView in       let list = title(-        List(links) { link in-          if let dest = link.destination {-            NavigationLink(link.id, destination: HStack {-              Spacer()-              dest-              Spacer()-            })-          } else {-            #if os(WASI)-            Text(link.id)-            #elseif os(macOS)-            Text(link.id).opacity(0.5)+        List {+          Section(header: Text("Buttons")) {+            NavItem("Counter", destination:+              Counter(count: Count(value: 5), limit: 15)+                .padding()+                .background(Color(red: 0.9, green: 0.9, blue: 0.9, opacity: 1.0))+                .border(Color.red, width: 3))+            NavItem("ButtonStyle", destination: ButtonStyleDemo())+          }+          Section(header: Text("Containers")) {+            NavItem("ForEach", destination: ForEachDemo())+            #if !os(macOS)+            if #available(iOS 14.0, *) {+              NavItem("List", destination: ListDemo().listStyle(InsetGroupedListStyle()))+            } else {+              NavItem("List", destination: ListDemo())+            }             #else-            HStack {-              Text(link.id)-              Spacer()-              Text("unavailable").opacity(0.5)+            NavItem("List", destination: ListDemo())+            #endif++            if #available(iOS 14.0, *) {+              NavItem("Sidebar", destination: SidebarListDemo().listStyle(SidebarListStyle()))+            } else {+              NavItem(unavailable: "Sidebar")+            }+            if #available(OSX 10.16, iOS 14.0, *) {+              NavItem("OutlineGroup", destination: OutlineGroupDemo())+            } else {+              NavItem(unavailable: "OutlineGroup")+            }+          }+          Section(header: Text("Layout")) {+            if #available(OSX 10.16, iOS 14.0, *) {+              NavItem("Grid", destination: GridDemo())+            } else {+              NavItem(unavailable: "Grid")             }+            NavItem("Spacer", destination: SpacerDemo())+            NavItem("ZStack", destination: ZStack {+              Text("I'm on bottom")+              Text("I'm forced to the top")+                .zIndex(1)+              Text("I'm on top")+            }.padding(20))+          }+          Section(header: Text("Selectors")) {+            NavItem("Picker", destination: PickerDemo())+            NavItem("Toggle", destination: ToggleDemo())+          }+          Section(header: Text("Text")) {+            NavItem("Text", destination: TextDemo())+            NavItem("TextField", destination: TextFieldDemo())+          }+          Section(header: Text("Misc")) {+            NavItem("Path", destination: PathDemo())+            NavItem("Environment", destination: EnvironmentDemo().font(.system(size: 8)))+            NavItem("Color", destination: ColorDemo())+            if #available(OSX 11.0, iOS 14.0, *) {+              NavItem("AppStorage", destination: AppStorageDemo())+            } else {+              NavItem(unavailable: "AppStorage")+            }+            if #available(OSX 11.0, iOS 14.0, *) {+              NavItem("Redact", destination: RedactDemo())

Good point! I went with “Redaction” which I think makes a little more sense.

j-f1

comment created time in 9 days

push eventswiftwasm/Tokamak

Jed Fox

commit sha 163eafdb67744093a4c0003614de53cd17ce66e1

RedactDemo → RedactionDemo

view details

push time in 9 days

push eventswiftwasm/Tokamak

Jed Fox

commit sha 66b8e15ecb113c8a11466aa9970b56a25036bc87

Redact → Redaction, move DOM refs to a TokamakDOM section, additional adjustments

view details

push time in 9 days

pull request commentswiftwasm/JavaScriptKit

Remove all methods from JSObjects to free up the property namespace

One last change I was going to make was changing the instanceof function to an operator. I tried it out with << which isn’t super clear.

It seems Swift doesn’t allow letters in operators, so instanceof is out. There are a ton of Unicode characters allowed but the only ASCII ones are !%&*+-/<=>?^|~. Maybe <<? or <==?

j-f1

comment created time in 9 days

pull request commentswiftwasm/JavaScriptKit

Remove all methods from JSObjects to free up the property namespace

Update: I’ve replaced all the function call/new logic with this pattern:

// JS version in comment
func() // func.apply(null, [])
func(arg1, arg2, arg3) // func.apply(null, [arg1, arg2, arg3])
func(args: [arg1, arg2, arg3]) // func.apply(null, [arg1, arg2, arg3])
func(this: foo) // func.apply(foo, [])
func(this: foo, arg1, arg2, arg3) // func.apply(foo, [arg1, arg2, arg3])
func(this: foo, args: [arg1, arg2, arg3]) // func.apply(foo,  [arg1, arg2, arg3])
func(new: arg1, arg2, arg3) // new func(arg1, arg2, arg3)
func(.new, args: [arg1, arg2, arg3]) // new func(arg1, arg2, arg3)
func(.new) // new func()

The last two I’m a little uncertain of.

j-f1

comment created time in 9 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha ec9a29a0362a5993e9b6f4008dcf17966a8b6d0c

Comment out failing tests

view details

Jed Fox

commit sha 3a4ccee93ff8830f3c4ff4d1378331bf3caf0197

Update function call signature

view details

push time in 9 days

push eventj-f1/forked-JavaScriptKit

Jed Fox

commit sha 39b15f4c1a9aaaf23c5aaeee20e4640d590611d9

Remove JSFunctionRef.apply and JSFunctionRef.new

view details

push time in 9 days

pull request commentswiftwasm/Tokamak

Slider

I think I’m done with this PR, and I plan to open an issue for the expand-to-fill-the-width thing.

j-f1

comment created time in 9 days

push eventswiftwasm/Tokamak

Jed Fox

commit sha 192f5fe6d11f154cfc0d2b1d672bd4d463b2c084

Update RedactDemo.swift

view details

push time in 9 days

push eventswiftwasm/Tokamak

Jed Fox

commit sha a73c4618fdfd31f733576d413dee5830eee34234

Remove slider demo

view details

push time in 9 days

more