HeapsIO / hxbit

Haxe Binary serialization and network synchronization library
155 stars 30 forks source link

breaks with dox, any suggested work round ? #52

Open nanjizal opened 4 years ago

nanjizal commented 4 years ago

Just thought I would add dox to hxTShopify, but I am getting a lot of errors Haxe Compiler 4.2.0-rc.1+5d48282d2 - (C)2005-2020 Haxe Foundation

/usr/local/lib/haxeLibrary/hxbit/git/hxbit/Schema.hx:42: characters 13-18 : Unknown identifier : __uid
/usr/local/lib/haxeLibrary/hxbit/git/hxbit/Schema.hx:43: characters 3-8 : Unknown identifier : __uid
/usr/local/lib/haxeLibrary/hxbit/git/hxbit/Schema.hx:45: characters 3-8 : Unknown identifier : __uid
/usr/local/lib/haxeLibrary/hxbit/git/hxbit/Serializer.hx:616: characters 23-28 : hxbit.Schema has no field __uid
/usr/local/lib/haxeLibrary/hxbit/git/hxbit/Serializer.hx:680: characters 24-29 : hxbit.Schema has no field __uid
src/hxTShopify/t/ProductSerializer.hx:4: characters 7-24 : Field __uid needed by hxbit.Serializable is missing
src/hxTShopify/t/ProductSerializer.hx:4: characters 7-24 : Field getCLID needed by hxbit.Serializable is missing
src/hxTShopify/t/ProductSerializer.hx:4: characters 7-24 : Field getSerializeSchema needed by hxbit.Serializable is missing
src/hxTShopify/t/ProductSerializer.hx:4: characters 7-24 : Field serialize needed by hxbit.Serializable is missing
src/hxTShopify/t/ProductSerializer.hx:4: characters 7-24 : Field unserialize needed by hxbit.Serializable is missing
src/hxTShopify/t/ProductSerializer.hx:4: characters 7-24 : Field unserializeInit needed by hxbit.Serializable is missing
/usr/local/lib/haxeLibrary/hxbit/git/hxbit/Schema.hx:27: characters 7-13 : Field __uid needed by hxbit.Serializable is missing
/usr/local/lib/haxeLibrary/hxbit/git/hxbit/Schema.hx:27: characters 7-13 : Field getCLID needed by hxbit.Serializable is missing
/usr/local/lib/haxeLibrary/hxbit/git/hxbit/Schema.hx:27: characters 7-13 : Field getSerializeSchema needed by hxbit.Serializable is missing
/usr/local/lib/haxeLibrary/hxbit/git/hxbit/Schema.hx:27: characters 7-13 : Field serialize needed by hxbit.Serializable is missing
/usr/local/lib/haxeLibrary/hxbit/git/hxbit/Schema.hx:27: characters 7-13 : Field unserialize needed by hxbit.Serializable is missing
/usr/local/lib/haxeLibrary/hxbit/git/hxbit/Schema.hx:27: characters 7-13 : Field unserializeInit needed by hxbit.Serializable is missing

My ProductSerializer I have not looked at recently but I think it worked fine last time I used it:

package hxTShopify.t;
import hxTShopify.t.Product;
import hxbit.Serializable;
class ProductSerializer implements hxbit.Serializable {
    @:s public var product : Product;
    public function new( product_ ){
        product = ( product_: ProductWrapper );
    }
    public static function product2Bytes( p: Product ): haxe.io.Bytes {
        var productSerializer = new ProductSerializer( new ProductWrapper( p ) );// important make sure id's are String
        var s = new hxbit.Serializer();
        var bytesOut = s.serialize( productSerializer );
        return bytesOut;
    }
    public static function bytes2Product( bytesIn: haxe.io.Bytes ): Product {
        var u = new hxbit.Serializer();
        var productSerializerOut = u.unserialize( bytesIn, ProductSerializer );
        return productSerializerOut.product;
    }
}

To see the error:

-cmd haxe git folderNode https://github.com/nanjizal/folderNode.git
# -cmd haxe git hxbit https://github.com/HeapsIO/hxbit.git # you probably have already!!
-cmd git clone https://github.com/nanjizal/hxTShopify.git
-cmd cd hxTShopify
-cmd haxe generateJS.hxml # or # -cmd haxe generateDoc.hxml
nanjizal commented 4 years ago

I commented out hxbit part to get dox to publish, but probably worth making libs compatible with dox if possible.