Merged
Conversation
…lected-ffi fails with errors and needs fixes
24f2f77 to
aee28f8
Compare
aee28f8 to
3bc6a7d
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are probably thinking something like "... but mate, you just came out with v3 a couple of months ago ... another rewrite?"
Yes because v3 was still not clean and "nightmarish" to maintain:
reflected-ffi/direct/encoderand itsdecoderutilities which are always fast, work with buffers, shared or not, but also arrays, and use always the fastest/easiest compromise that ensure correctness and it's 100% test covered. encoder and decoder are still part of the options though but the default is not JSON anymore, it's something that can travel at native speed as buffer in both postMessage and/or WebSocket messages and it's still as fast as it can get in most common cases. Abufferextra option has been added to also pass buffers as these are and avoid bloat and conversion of typed views which was crucial to unlock some use case.Long story short, this module is now way more essential, the reflected-ffi has zero dependencies so that it can keep pace with ease and it doesn't even need to be bundled (which is always suggested, still ...) so that it can be tested in isolation out of the box without needing import maps or other things.
New in v4
ffifield that contains:document.body.children[2].outerHTML(single roundtrip)postMessageand WebSockets synchronous and asynchronous dances, nothing elseBreaking in v4
All encoders and decoders, all dependencies that are not used/needed, and the whole proxy folder has been removed, making the
package.jsoneasier to reason about and follow but if you were reaching out this module to use any of those dependencies these are not available anymore but of course,v3still offer those and encoder or decoder are still compatible with this API so you can eventually port previous code to work with this latest version of the library.