Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Releases: lxsmnsyc/seroval

v1.2.0

07 Jan 12:10
8554d15
This commit was signed with the committer’sverified signature.
lxsmnsyc Alexis H. Munsayac
GPG key ID:70156DB15D31D134
Verified
Learn about vigilant mode.
Compare
Choose a tag to compare
Loading
  • AddAbortSignal to serializable values
Assets2
Loading

v1.1.0

14 Jul 06:12
1746c7b
This commit was signed with the committer’sverified signature.
lxsmnsyc Alexis H. Munsayac
GPG key ID:70156DB15D31D134
Verified
Learn about vigilant mode.
Compare
Choose a tag to compare
Loading

This feature adds a very basicOpaqueReference class. The purpose of this class is to wrap user-specified values into "opaque references": references that are hidden from the serializer. AnOpaqueReference contains two values: the original value it is trying to hide, and an optional replacement value, which is what the serializer "sees".

A replacement value can only bea value that seroval can serialize. By default, a replacement value isundefined.

Example:

import{serialize,deserialize,OpaqueReference}from'seroval';constexample={transparent:"This is a transparent value.",opaque:newOpaqueReference('This is an opaque value.'),};// You can still access the original value:console.log(example.opaque.value);// but now it's differentconstdeserialized=deserialize(serialize(example));console.log(deserialized.opaque);// undefined
Loading
bigmistqke reacted with hooray emoji
1 person reacted

v1.0.0

12 Dec 04:10
Compare
Choose a tag to compare
Loading

What's Changed

  • IntroducecreateStreama403955
    • This function provides a universal streaming primitive that users can use.ReadableStream isn't a JS standard and so there was no counterpart toPromise when it comes to streaming data, so I had to introduce a minimal streaming primitive that is both portable and serializable.
  • Createseroval-plugins22dcc59
    • This package is dedicated for authoring plugins.
    • Given thatcreateStream has been introduced, seroval is no longer dependent from theReadableStream API, which makes seroval no longer tied to the Web API too.
  • Move the following Web API support toseroval-plugins/web
    • Blob
    • CustomEvent
    • DOMException
    • Event
    • File
    • FormData
    • Headers
    • ReadableStream
    • Request
    • Response
    • URLSearchParams
    • URL
  • Deprecate some feature flags. The following features can no longer be disabled:
    • Set
    • Map
    • Promise
    • BigInt
    • TypedArray
    • Symbol
    • WebAPI
  • Plugin parsing is now on a higher priority, which would allow users to customize serialization for things like plain objects.
  • Promise andAsyncIterable is now supported in sync mode, but will only generate a non-resolving instance.
  • Addextends option to Plugins API. This allows the plugins to require other plugins in case the feature is required (e.g.Request relies on bothHeaders andReadableStream)

Fixes

  • FixRegExp serialization
  • Fix string deserialization
  • Fix plugin tag deserialization check
  • Fix treeshaking for top-level variables

Full Changelog:v0.15.1...v1.0.0

Loading
aecea reacted with heart emoji
1 person reacted

0.13.0

18 Nov 15:01
Compare
Choose a tag to compare
Loading
  • Add the following APIs:
    • toCrossJSON
    • toCrossJSONAsync
    • toCrossJSONStream
    • fromCrossJSON
  • Add support forReadableStream in async modes
  • Add support forAsyncIterable in async and streaming modes
  • AddSymbol.toStringTag andSymbol.isConcatSpreadable in serialized properties
  • DeprecateMethodShorthand andArrayPrototypeValues inFeature
  • ReworkIterable serialization output
  • Dedupe hidden references
  • Fix Plugin API-related behavior
  • Remove Plugin API'sisIterable
Loading

v0.12.0

19 Oct 06:13
Compare
Choose a tag to compare
Loading
  • Add the Plugin API
    • This feature allows custom serialization/deserialization API in seroval. The feature required massive restructuring in the core, such as moving the whole parser, serializer and deserializer code from functions to class-based, which will allow deduping and a lot more. It's required so that the underlying methods can be exposed for the plugin methods.
    • This resolves#17
    • This resolves#14
    • Example:
    import{createPlugin,serialize,typeSerovalNode,}from'seroval';constBufferPlugin=createPlugin<Buffer,SerovalNode>({tag:'Buffer',test(value){returnvalueinstanceofBuffer;},parse:{sync(value,ctx){returnctx.parse(value.toString('base64'));},asyncasync(value,ctx){returnctx.parse(value.toString('base64'));},stream(value,ctx){returnctx.parse(value.toString('base64'));},},serialize(node,ctx){return`Buffer.from(${ctx.serialize(node)}, "base64")`;},deserialize(node,ctx){returnBuffer.from(ctx.deserialize(node)asstring,'base64');},isIterable(){returntrue;},});constserializedJS=serialize(Buffer.from('Hello World','utf-8'),{plugins:[BufferPlugin],},);
  • Fixes#27
  • Fixes#28
Loading

v0.11.0

11 Oct 08:37
Compare
Choose a tag to compare
Loading
  • AddRequest support
  • AddResponse support
  • AddEvent support
  • AddCustomEvent support
  • AddDOMException support
  • Fix runtime feature flag check during parsing process
    • This way, the feature flag not only applies to the target runtime of the compiled output, but also for the parsing runtime.
    • This change affects the following behavior:
      • Map andSet now falls back toSymbol.iterator if disabled.
      • ArrayBuffer andDataView to requireFeature.TypedArray (due to how both requiresUint8Array)
      • Indirectly, classes likeBlob andFile is now indirectly affected by theFeature.TypedArray
Loading

v0.10.0

18 Sep 02:36
Compare
Choose a tag to compare
Loading
  • Add the cross-referencing serializer mode
    • This mode allows multiple calls of serialization to share the same reference maps, a behavior that's not present in current existing modes. This introducescrossSerialize andcrossSerializeAsync. JSON variants will be introduced in the future.
  • Add the streaming serializer mode (#5)
    • With the addition of the cross-referencing serializer, it's now possible forseroval to stream serialized data but with a new API. This release introduces thecrossSerializeStream and theSerializer class, both provides two kinds of streaming format (the former being a one-time read-only stream, while the latter allowing push data).
  • FixPromise serialization to consider rejected instances.
    • Previouslyseroval throws on rejected Promises, which shouldn't be the case and is most likely a bad design, given thatseroval can also serialize Error instances.
  • AddReadableStream support.
    • Currently only available incrossSerializeStream andSerializer class.
  • Restructure docs
    • Since there are two READMEs in the repo, it's a bit of redundant work to maintain one of it (and paste it to the other) so I've decided to separate the docs. Docs are still a WIP but most of it is still usable.

Full Changelog:v0.9.0...v0.10.0

Loading

v0.9.0

07 Jul 09:14
Compare
Choose a tag to compare
Loading
  • Adds support for serializing object state (e.g.Object.freeze,Object.seal andObject.preventExtensions)
  • Fix object assign compat
Loading

v0.8.0

03 May 09:50
Compare
Choose a tag to compare
Loading
  • Resolves#16
    • Iterable is no longer a separate kind of node, it's now a subset of eitherObject orNullConstructor (depending onconstructor).
    • Feature.Symbol no longer disables the use ofSymbol.iterator inIterable. Iterable protocol is now skipped.
  • ReplaceUndefined,Null,Boolean,NaN,NegativeZero,Infinity andNegativeInfinity with theConstant Node.
  • Fix deserialization step for objects with zero properties returning a different reference.
  • Drop support forPromiseLike (akaThenables) due to the potential DoS
  • Add support for boxed primitives
  • Fix parsing errors to be descriptive
  • optimize serialization

What's Changed

New Contributors

Full Changelog:v0.7.0...v0.8.0

Contributors

  • @lxsmnsyc
  • @samualtnorman
lxsmnsyc and samualtnorman
Loading

v0.7.0

09 Apr 14:26
Compare
Choose a tag to compare
Loading
  • Add support forArrayBuffercdd0ed8
  • Fix serialization for Typed Arrays
    • SinceArrayBuffer support has been added, this change includes dedupingTypedArray.prototype.buffer references, applying proper byte offset and length, as well as changes to encoding format (which is now delegated to theArrayBuffer source)
  • Fix deserialization for Typed Arrays encoded in JSON format
    • Since typed arrays cannot resize, there has been issues where typed arrays remained empty.
  • Add support forDataView28fd1ac
  • Add support forBlobec017d7
  • Fix serialization issues of types with serialized properties
  • Add support forFiled598849
  • Add support forHeaders3ee4191
  • Add support forFormDataa466500

Full Changelog:v0.6.0...v0.7.0

Loading
mzaien, yhdgms1, and bigmistqke reacted with rocket emoji
3 people reacted
Previous1
Previous

[8]ページ先頭

©2009-2025 Movatter.jp