profile
viewpoint
Francisco Ryan Tolmasky I tolmasky San Francisco, CA http://alertdebugging.com

subethaedit/SubEthaEdit 1118

General purpose plain text editor for macOS. Widely known for its live collaboration feature.

tolmasky/language 412

A fast PEG parser written in JavaScript with first class errors

eatnumber1/goal 322

g()()()()('al') → "gooooal"

Me1000/CappuTweetie 34

Tweetie Written in Cappuccino

tolmasky/MapKit 8

A Google Maps API abstraction layer written for Cappuccino

tolmasky/alertdebugging.com 2

My personal blog

tolmasky/narwhal 2

A JavaScript standard library, package manager, and more.

tolmasky/narwhal-jsc 2

Narwhal support for JavaScriptCore (incomplete)

pull request commentcappuccino/cappuccino

Fix version check for XcodeCapp compatibility with Big Sur

This was intentional, but the cutoff point was somewhat arbitrary - 10.12 represents a convenient dividing line between deprecated and mostly modern Cocoa (for both XcodeCapp and APIs).

The project should ideally have a global statement about support cutoff.

enquora

comment created time in 17 hours

issue commentwebsockets/ws

Use Node.js 15 native `EventTarget` object

target field of Event class is read-only, and we are assigning it. I've reviewed Node.js source code and it's only set by private [kHybridDispatch]() method, so it's not possible to only do first step, we'll need to go directly to use Node.js native EventTarget or NodeEventTarget class, not just only the native Event class :-/

piranna

comment created time in a day

pull request commentcappuccino/cappuccino

Fix version check for XcodeCapp compatibility with Big Sur

@mrcarlberg @enquora With this commit, the min version for Xcode changed from 10.7 to 10.12. Is it intentional ? because it's not in the pr description.

enquora

comment created time in a day

issue closedcappuccino/cappuccino

nib2cib fails with OSX 11.0.1 and Xcode 12.2

I've created a standard new project which produces an error of Converting xib file to plist... Could not compile file: ...... /Resources/MainMenu.xib when either using XCodeCapp or nib2cib. When first opening MainMenu.xib in xcode I get a warning that the file is an old format and the options presented are either to open and upgrade the file or cancel. nib2cib fails both before opening the xib in xcode and after 'upgrading'. Screenshot 2020-11-23 at 09 46 12

The full terminal record from capp gen to nib2cib here: Terminal.txt

There is an original MainMenu.cib file created when the project is created.

closed time in a day

djbewick

issue commentcappuccino/cappuccino

nib2cib fails with OSX 11.0.1 and Xcode 12.2

Now running cappuccino 1.0.0 (2020-03-26 dd781f) and the problem has gone. My apologies.

djbewick

comment created time in a day

issue commentcappuccino/cappuccino

nib2cib fails with OSX 11.0.1 and Xcode 12.2

Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.

djbewick

comment created time in a day

issue commentcappuccino/cappuccino

nib2cib fails with OSX 11.0.1 and Xcode 12.2

Hi!

What version of Cappuccino do you use? Have you tried the latest version from master?

We have recently merged in a pull request that should have upgraded the templates for new applications. Please check #2946.

djbewick

comment created time in a day

issue openedcappuccino/cappuccino

nib2cib fails with OSX 11.0.1 and Xcode 12.2

I've created a standard new project which produces an error of Converting xib file to plist... Could not compile file: ...... /Resources/MainMenu.xib when either using XCodeCapp or nib2cib. When first opening MainMenu.xib in xcode I get a warning that the file is an old format and the options presented are either to open and upgrade the file or cancel. nib2cib fails both before opening the xib in xcode and after 'upgrading'. Screenshot 2020-11-23 at 09 46 12

The full terminal record from capp gen to nib2cib here: Terminal.txt

There is an original MainMenu.cib file created when the project is created.

created time in a day

issue commentwebsockets/ws

Use Node.js 15 native `EventTarget` object

After taking a more carefully look, probably this can be splitted in two tasks:

  1. use native Event class
  2. use native EventTarget or NodeEventTarget class

First one is just a data container, so it's easy to replace, and that would fix the current error since it's doing a validation that the provided object inherit from the Event class, so it would work and probably second one would not be needed (or would get a lower priority).

piranna

comment created time in a day

issue commentwebsockets/ws

Use Node.js 15 native `EventTarget` object

Also there are some node packages with binary blobs that aren't ready, and don't yet work under Node v15. I use one of those closely tied to ws (wrtc)

piranna

comment created time in a day

pull request commentcappuccino/cappuccino

FIXED: Before this PR, CPTabView was badly positioned

Merged! Thanks!

didierkorthoudt

comment created time in 2 days

push eventcappuccino/cappuccino

Didier Korthoudt

commit sha 3aba03eb2891e70ef98c016194f6e16a2d95b0e9

Fixed: Missing call to super in NSTabView.j (#2956)

view details

push time in 2 days

PR merged cappuccino/cappuccino

FIXED: Before this PR, CPTabView was badly positioned #new

A call to [super awakeFromCib] was missing in nib2cib NSTabView.j (it was commented for tests in development branch).

This PR simply reintroduces this call.

+3 -0

1 comment

1 changed file

didierkorthoudt

pr closed time in 2 days

pull request commentcappuccino/cappuccino

Aristo3: various _CPImageAndTextView bugs

@mrcarlberg @cacaodev The centering stuff also impacts CPImageView so I suggest to deal with it in another PR. So this one is done.

didierkorthoudt

comment created time in 3 days

issue commentwebsockets/ws

Use Node.js 15 native `EventTarget` object

I prefer to keep making WebSocket inherit from EventEmitter for now.

Advantages:

  • No breaking changes.
  • No feature detection and polyfill.
  • The WebSocket class is always an EventEmitter and the documentation is the same in all supported Node.js versions.
  • No performance regressions.

Disadvantages:

  • Some compatibility issues between the very simple ws EventTarget implementation and the Node.js EventTarget implementation.

That said, I think making WebSocket inherit from NodeEventTarget is something worth exploring.

piranna

comment created time in 3 days

issue commentwebsockets/ws

Use Node.js 15 native `EventTarget` object

Reading Node.js EventTarget source code, it shows events list is implemented with a private SafeMap, and that's what NodeEventTarget uses for the listenerCount() count method. We would need to change its implementation, but if both emitter.prependListener() and emitter.listeners() are needed and can be used an alternative, seems it's possible to implement them there... just not something immediate.

piranna

comment created time in 3 days

issue commentwebsockets/ws

Use Node.js 15 native `EventTarget` object

One important missing API is emitter.prependListener() and emitter.listeners(). It would still be a breaking change

Is it actually being used? We could take a look for what NodeEventTarget missing features are being used and identify if they can be fixed someway.

I'm still worried about performance regressions. I didn't follow the EventTarget implementation closely in Node.js and I'm not sure if it was about NodeEventTarget but I remember some benchmarks where EventTarget was an order of magnitude slower than the EventEmitter.

I somewhat remember something about that, but an order of magnitude is too much... How are ws benchmarks being done? Maybe we can work in a separate branch and check for them...

piranna

comment created time in 3 days

issue commentwebsockets/ws

Use Node.js 15 native `EventTarget` object

Or maybe yes :-) NodeEventTarget extends from EventTarget and implements the EventEmitter API on top of it. I read in the development discussion that it was specifically designed for compatibility and migration issues, so if you are concerned about that, probably this would be the correct aproach to begin with.

Ok, but NodeEventTarget currently only implements a subset of the EventEmitter API. One important missing API is emitter.prependListener(). It would still be a breaking change and I'm still worried about performance regressions. I didn't follow the EventTarget implementation closely in Node.js and I'm not sure if it was about NodeEventTarget but I remember some benchmarks where EventTarget was an order of magnitude slower than the EventEmitter.

piranna

comment created time in 3 days

issue commentwebsockets/ws

Use Node.js 15 native `EventTarget` object

I think it is not possible to use the Node.js EventTarget implementation without introducing breaking changes and performance regressions.

Or maybe yes :-) NodeEventTarget extends from EventTarget and implements the EventEmitter API on top of it. I read in the development discussion that it was specifically designed for compatibility and migration issues, so if you are concerned about that, probably this would be the correct aproach to begin with.

Can't you use the EventEmitter interface in your code? Make Client inherits from EventTarget and use ws.{on,once}() instead of ws.addEventListener().

I didn't consider that, since by inertia I always use the W3C API for compatibility between browser and Node.js, but yes, it's something I can do since in this case it would be a Node.js only code :-)

piranna

comment created time in 3 days

issue commentwebsockets/ws

Use Node.js 15 native `EventTarget` object

I think it is not possible to use the Node.js EventTarget implementation without introducing breaking changes and possibly performance regressions.

  • We would need to call ws.dispatchEvent() every time we call ws.emit().
  • I'm not sure what to do with non standard events like 'ping', 'pong', 'unexpected-response', and 'upgrade'. Currently the listeners of these events do not receive an Event even if they are added via ws.addEventListener()

The ws implementation relies on the EventEmitter interface.

If I could go back in time I would have never made the WebSocket and EventTarget. Anyway the feature was added before I started contributing to ws and I think the reason was to have a browser compatibile interface.


Can't you use the EventEmitter interface in your code? Make Client inherits from EventTarget and use ws.{on,once}() instead of ws.addEventListener().

piranna

comment created time in 3 days

pull request commentcappuccino/cappuccino

FIXED: Before this PR, CPTabView was badly positioned

Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.

didierkorthoudt

comment created time in 3 days

PR opened cappuccino/cappuccino

FIXED: Before this PR, CPTabView was badly positioned

A missing call to [super awakeFromCib] was missing in nib2cib NSTabView.j (it was commented for tests in development branch).

This PR simply reintroduce this call.

+3 -0

0 comment

1 changed file

pr created time in 3 days

issue openedwebsockets/ws

Use Node.js 15 native `EventTarget` object

  • [x] I've searched for any related issues and avoided creating a duplicate issue.

Description

Node.js 15 already provides a native implementation of EventTarget, so there's no need to use our own implementation. In fact, using both of them at the same time leads to errors.

In my use case, I've created a Client class that extends from Node.js native EventTarget class, that internally it's using an ws instance (and doing some other project specific things), and setting as listeners methods from this Client class, with the idea of propagate these errors to the user:

export class Client extends EventTarget
{
  constructor(ws)
  {
    super()

    if(!(ws instanceof WebSocket)) ws = new WebSocket(ws)

    ws.binaryType = 'arraybuffer'

    ws.addEventListener('close', this.#onClose, {once: true})
    ws.addEventListener('error', this.#onError)
    ws.addEventListener('message', this.#onMessage)
    ws.addEventListener('open', this.#onOpen, {once: true})

    this.#ws = ws
  }

  #onClose = this.dispatchEvent.bind(this)
  #onError = this.dispatchEvent.bind(this)
  #onOpen  = this.dispatchEvent.bind(this)
}

Problem is, since ws is using its own implementation of both EventTarget and Event classes, when these events gets propagated to the native one, I get the next error:

TypeError [ERR_INVALID_ARG_TYPE]: The "event" argument must be an instance of Event. Received an instance of ErrorEvent
    at new NodeError (node:internal/errors:277:15)
    at EventTarget.dispatchEvent (node:internal/event_target:326:13)
    at WebSocket.onError (/home/piranna/Trabajo/Atos/awrtc_signaling/node_modules/ws/lib/event-target.js:141:16)
    at WebSocket.emit (node:events:329:20)
    at WebSocket.EventEmitter.emit (node:domain:467:12)
    at ClientRequest.<anonymous> (/home/piranna/Trabajo/Atos/awrtc_signaling/node_modules/ws/lib/websocket.js:579:15)
    at ClientRequest.emit (node:events:329:20)
    at ClientRequest.EventEmitter.emit (node:domain:467:12)
    at TLSSocket.socketErrorListener (node:_http_client:478:9)
    at TLSSocket.emit (node:events:329:20) {
  code: 'ERR_INVALID_ARG_TYPE'
}

This is due because Node.js native EventTarget class is expecting a native Event class instance, instead of the one provided by ws. According to Node.js docs it should be accepting any object with a type field, but for some reason is not accepting it.

Reproducible in:

  • version: 7.4.0
  • Node.js version(s): 15.2.0
  • OS version(s): Ubuntu 20.10

Steps to reproduce:

  1. use Node.js 15
  2. create an object instance with Node.js 15 native EventTarget class in its prototype chain
  3. create a ws instance and call to addEventListener setting one function that propagate the event to the native EventTarget
  4. emit the event
  5. BOOM

Expected result:

ws should check for actual support of both Event and EventTarget classes in the native platform (in this case, Node.js 15) and use them. In case they are not available, then use its own implementation as a polyfill.

Actual result:

ws is using always its own implementation of Event and EventTarget classes, since there was none before, so now it conflicts with the new Node.js native available ones.

created time in 3 days

issue commentwebsockets/ws

Creating websocket.Server from http2.createSecureServer

Hey there is support for WebSockets over HTTP/2 now.

https://tools.ietf.org/html/rfc8441

i would like to know if it just got forgotted or are there some other reason

cTn-dev

comment created time in 4 days

issue commentcappuccino/cappuccino

Vertical alignment of 'Loading' animation for index.html is broken in Safari, Edge

Fixed with merging of PR2953

enquora

comment created time in 4 days

issue closedcappuccino/cappuccino

Vertical alignment of 'Loading' animation for index.html is broken in Safari, Edge

The vertical alignment of the 'Loading' animation is no longer correct in recent Safari versions and Edge. It is at the very top of the page.

The current implementation depends on using the 'table' display mode for divs but is no longer reliably producing the desired effect.

The modern way to do this is using flexbox, but rules out usage in Internet Explorer. Are we still making any effort to support IE?

If so, a more complete layout using table appears necessary.

closed time in 4 days

enquora

pull request commentcappuccino/cappuccino

Aristo3: various _CPImageAndTextView bugs

@mrcarlberg Well, I'll try to implement @cacaodev suggestion. Please hold on this one for now.

didierkorthoudt

comment created time in 4 days

issue commentsubethaedit/SubEthaEdit

triple click does not select full line

Thank you so much for your time and all the great work on SEE, my editor of choice since its initial release 👍

marc-guenther

comment created time in 4 days

pull request commentcappuccino/cappuccino

Aristo3: CPTabView (needs #2924)

Merged! Thanks!

didierkorthoudt

comment created time in 4 days

push eventcappuccino/cappuccino

Didier Korthoudt

commit sha 1107195ab6a2e4137431d95c2dcc8a8e306df73f

Fixed: Modern Cocoa behavior, new theme parameters, Aristo3 CSS theme ready for CPTabView (#2936)

view details

push time in 4 days

more