@javelin/track
Advanced tools
Comparing version 1.0.0-alpha.2 to 1.0.0-alpha.3
@@ -6,2 +6,20 @@ # Change Log | ||
# [1.0.0-alpha.3](https://github.com/3mcd/javelin/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2021-05-23) | ||
### Bug Fixes | ||
* use uint32 for message part byte length ([aa96bb6](https://github.com/3mcd/javelin/commit/aa96bb6901ccbd24044492bc1ae1859f614fa78d)) | ||
### Features | ||
* add set and map types to components ([cd67a1b](https://github.com/3mcd/javelin/commit/cd67a1b87ec475157a98863b8ef1c7a862ce7c13)) | ||
* model enhancements ([65bbe77](https://github.com/3mcd/javelin/commit/65bbe772b631bf06b71870348827c315c397fbc4)) | ||
* more api improvements ([6e4f27b](https://github.com/3mcd/javelin/commit/6e4f27b8e200ed49679e1512dccc1fea22010841)) | ||
# [1.0.0-alpha.2](https://github.com/3mcd/javelin/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2021-05-18) | ||
@@ -8,0 +26,0 @@ |
export declare const ChangeSetRecord: { | ||
path: import("@javelin/core").DataTypeString; | ||
field: import("@javelin/core").DataTypeNumber; | ||
split: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
traverse: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
path: import("@javelin/core").FieldString; | ||
field: import("@javelin/core").FieldNumber; | ||
split: import("@javelin/core").FieldArray<string>; | ||
traverse: import("@javelin/core").FieldArray<string>; | ||
}; | ||
export declare const ChangeSetArrayOp: { | ||
method: import("@javelin/core").DataTypeNumber; | ||
method: import("@javelin/core").FieldNumber; | ||
record: { | ||
path: import("@javelin/core").DataTypeString; | ||
field: import("@javelin/core").DataTypeNumber; | ||
split: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
traverse: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
path: import("@javelin/core").FieldString; | ||
field: import("@javelin/core").FieldNumber; | ||
split: import("@javelin/core").FieldArray<string>; | ||
traverse: import("@javelin/core").FieldArray<string>; | ||
}; | ||
values: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeDynamic>; | ||
start: import("@javelin/core").DataTypeNumber; | ||
deleteCount: import("@javelin/core").DataTypeNumber; | ||
values: import("@javelin/core").FieldArray<unknown>; | ||
start: import("@javelin/core").FieldNumber; | ||
deleteCount: import("@javelin/core").FieldNumber; | ||
}; | ||
export declare const ChangeSet: { | ||
changes: import("@javelin/core").ObjectType<{ | ||
fields: import("@javelin/core").ObjectType<{ | ||
noop: import("@javelin/core").DataTypeBoolean; | ||
value: import("@javelin/core").DataTypeDynamic; | ||
changes: import("@javelin/core").FieldObject<{ | ||
fields: import("@javelin/core").StringMap<{ | ||
noop: boolean; | ||
value: unknown; | ||
record: { | ||
path: import("@javelin/core").DataTypeString; | ||
field: import("@javelin/core").DataTypeNumber; | ||
split: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
traverse: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
path: string; | ||
field: number; | ||
split: string[]; | ||
traverse: string[]; | ||
}; | ||
}>; | ||
array: import("@javelin/core").ArrayType<{ | ||
method: import("@javelin/core").DataTypeNumber; | ||
array: { | ||
method: number; | ||
record: { | ||
path: import("@javelin/core").DataTypeString; | ||
field: import("@javelin/core").DataTypeNumber; | ||
split: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
traverse: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
path: string; | ||
field: number; | ||
split: string[]; | ||
traverse: string[]; | ||
}; | ||
values: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeDynamic>; | ||
start: import("@javelin/core").DataTypeNumber; | ||
deleteCount: import("@javelin/core").DataTypeNumber; | ||
}>; | ||
fieldCount: import("@javelin/core").DataTypeNumber; | ||
arrayCount: import("@javelin/core").DataTypeNumber; | ||
values: unknown[]; | ||
start: number; | ||
deleteCount: number; | ||
}[]; | ||
fieldCount: number; | ||
arrayCount: number; | ||
}>; | ||
size: import("@javelin/core").DataTypeNumber; | ||
touched: import("@javelin/core").DataTypeBoolean; | ||
size: import("@javelin/core").FieldNumber; | ||
touched: import("@javelin/core").FieldBoolean; | ||
}; | ||
//# sourceMappingURL=change_set.d.ts.map |
@@ -14,3 +14,3 @@ "use strict"; | ||
record: exports.ChangeSetRecord, | ||
values: core_1.arrayOf(core_1.dynamic), | ||
values: core_1.arrayOf(core_1.dynamic()), | ||
start: core_1.number, | ||
@@ -23,3 +23,3 @@ deleteCount: core_1.number, | ||
noop: core_1.boolean, | ||
value: core_1.dynamic, | ||
value: core_1.dynamic(), | ||
record: exports.ChangeSetRecord, | ||
@@ -26,0 +26,0 @@ }), |
@@ -1,2 +0,3 @@ | ||
export * from "./change_set_utils"; | ||
export * from "./apply"; | ||
export * from "./write"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -13,3 +13,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./change_set_utils"), exports); | ||
__exportStar(require("./apply"), exports); | ||
__exportStar(require("./write"), exports); | ||
//# sourceMappingURL=index.js.map |
export declare const ChangeSetRecord: { | ||
path: import("@javelin/core").DataTypeString; | ||
field: import("@javelin/core").DataTypeNumber; | ||
split: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
traverse: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
path: import("@javelin/core").FieldString; | ||
field: import("@javelin/core").FieldNumber; | ||
split: import("@javelin/core").FieldArray<string>; | ||
traverse: import("@javelin/core").FieldArray<string>; | ||
}; | ||
export declare const ChangeSetArrayOp: { | ||
method: import("@javelin/core").DataTypeNumber; | ||
method: import("@javelin/core").FieldNumber; | ||
record: { | ||
path: import("@javelin/core").DataTypeString; | ||
field: import("@javelin/core").DataTypeNumber; | ||
split: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
traverse: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
path: import("@javelin/core").FieldString; | ||
field: import("@javelin/core").FieldNumber; | ||
split: import("@javelin/core").FieldArray<string>; | ||
traverse: import("@javelin/core").FieldArray<string>; | ||
}; | ||
values: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeDynamic>; | ||
start: import("@javelin/core").DataTypeNumber; | ||
deleteCount: import("@javelin/core").DataTypeNumber; | ||
values: import("@javelin/core").FieldArray<unknown>; | ||
start: import("@javelin/core").FieldNumber; | ||
deleteCount: import("@javelin/core").FieldNumber; | ||
}; | ||
export declare const ChangeSet: { | ||
changes: import("@javelin/core").ObjectType<{ | ||
fields: import("@javelin/core").ObjectType<{ | ||
noop: import("@javelin/core").DataTypeBoolean; | ||
value: import("@javelin/core").DataTypeDynamic; | ||
changes: import("@javelin/core").FieldObject<{ | ||
fields: import("@javelin/core").StringMap<{ | ||
noop: boolean; | ||
value: unknown; | ||
record: { | ||
path: import("@javelin/core").DataTypeString; | ||
field: import("@javelin/core").DataTypeNumber; | ||
split: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
traverse: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
path: string; | ||
field: number; | ||
split: string[]; | ||
traverse: string[]; | ||
}; | ||
}>; | ||
array: import("@javelin/core").ArrayType<{ | ||
method: import("@javelin/core").DataTypeNumber; | ||
array: { | ||
method: number; | ||
record: { | ||
path: import("@javelin/core").DataTypeString; | ||
field: import("@javelin/core").DataTypeNumber; | ||
split: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
traverse: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeString>; | ||
path: string; | ||
field: number; | ||
split: string[]; | ||
traverse: string[]; | ||
}; | ||
values: import("@javelin/core").ArrayType<import("@javelin/core").DataTypeDynamic>; | ||
start: import("@javelin/core").DataTypeNumber; | ||
deleteCount: import("@javelin/core").DataTypeNumber; | ||
}>; | ||
fieldCount: import("@javelin/core").DataTypeNumber; | ||
arrayCount: import("@javelin/core").DataTypeNumber; | ||
values: unknown[]; | ||
start: number; | ||
deleteCount: number; | ||
}[]; | ||
fieldCount: number; | ||
arrayCount: number; | ||
}>; | ||
size: import("@javelin/core").DataTypeNumber; | ||
touched: import("@javelin/core").DataTypeBoolean; | ||
size: import("@javelin/core").FieldNumber; | ||
touched: import("@javelin/core").FieldBoolean; | ||
}; | ||
//# sourceMappingURL=change_set.d.ts.map |
@@ -11,3 +11,3 @@ import { arrayOf, boolean, dynamic, number, objectOf, string, } from "@javelin/core"; | ||
record: ChangeSetRecord, | ||
values: arrayOf(dynamic), | ||
values: arrayOf(dynamic()), | ||
start: number, | ||
@@ -20,3 +20,3 @@ deleteCount: number, | ||
noop: boolean, | ||
value: dynamic, | ||
value: dynamic(), | ||
record: ChangeSetRecord, | ||
@@ -23,0 +23,0 @@ }), |
@@ -1,2 +0,3 @@ | ||
export * from "./change_set_utils"; | ||
export * from "./apply"; | ||
export * from "./write"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,3 @@ | ||
export * from "./change_set_utils"; | ||
export * from "./apply"; | ||
export * from "./write"; | ||
//# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Javelin={})}(this,(function(e){"use strict";var t;!function(e){e[e.Internal=0]="Internal",e[e.Query=1]="Query"}(t||(t={}));t.Internal,t.Query;const o=Symbol("javelin_model_flat"),n=Symbol("javelin_model_struct");var r,s;!function(e){e[e.Primitive=0]="Primitive",e[e.Array=1]="Array",e[e.Object=2]="Object",e[e.Set=3]="Set",e[e.Map=4]="Map"}(r||(r={})),function(e){e.Number="number",e.Boolean="boolean",e.String="string",e.Dynamic="dynamic"}(s||(s={}));const a={__kind__:r.Primitive,__type__:s.Number,create:()=>0,reset:(e,t)=>e[t]=0},i={__kind__:r.Primitive,__type__:s.String,create:()=>"",reset:(e,t)=>e[t]=0},l={__kind__:r.Primitive,__type__:s.Boolean,create:()=>!1,reset:(e,t)=>e[t]=0},u={__kind__:r.Primitive,__type__:s.Dynamic,create:()=>null,reset:(e,t)=>e[t]=null},c=e=>({__kind__:r.Array,__type__:e}),d=e=>({__kind__:r.Object,__type__:e});const h={path:i,field:a,split:c(i),traverse:c(i)},f={method:a,record:h,values:c(u),start:a,deleteCount:a},_={changes:d({fields:d({noop:l,value:u,record:h}),array:c(f),fieldCount:a,arrayCount:a}),size:a,touched:l};var p;(p=e.MutArrayMethod||(e.MutArrayMethod={}))[p.Pop=0]="Pop",p[p.Push=1]="Push",p[p.Shift=2]="Shift",p[p.Unshift=3]="Unshift",p[p.Splice=4]="Splice";const y={schemaIndex:new WeakMap,model:{[o]:{}},worlds:[],currentWorldId:-1};var v;!function(e){e[e.Spawn=0]="Spawn",e[e.Attach=1]="Attach",e[e.Detach=2]="Detach",e[e.Mutate=3]="Mutate",e[e.Destroy=4]="Destroy"}(v||(v={}));const C={},g=function(e,t,o){const n=[],r=()=>{for(let t=0;t<o;t++)n.push(e(s))},s={allocate:r,retain:()=>(n.length||r(),n.pop()),release:e=>{n.push(t(e))}};return s}(()=>({method:-1,record:null,values:[],start:-1,insert:-1,deleteCount:-1}),e=>(e.method=-1,e.record=null,function(e){for(;e.length>0;)e.pop()}(e.values),e),1e4),m=(e,t)=>{const{__type__:o}=e;let s=C[o];void 0===s&&(s=C[o]={});let a=s[t];if(void 0===a){let e=y.model[o];const i=[],l=t.split(".");for(let t=0;t<l.length;t++){const o=l[t];switch(e.kind){case r.Array:case r.Object:e=e.edge,i.push(o);break;case n:e=e.keys[o]}}s[t]=a={traverse:i,path:t,split:l,field:e.id}}return a};function M(e,t){let o=e.changes[t];return void 0===o&&(o=e.changes[t]={fields:{},array:[],fieldCount:0,arrayCount:0}),o}e.ChangeSet=_,e.ChangeSetArrayOp=f,e.ChangeSetRecord=h,e.copy=function(e,t){if(!1!==e.touched){t.touched=!0;for(const o in e.changes){const n=e.changes[o];if(0===n.fieldCount)continue;let r=t.changes[o];void 0===r&&(r=t.changes[o]={fields:{},array:[],fieldCount:0,arrayCount:0}),0===r.fieldCount&&t.size++;for(const e in n.fields){const t=n.fields[e];if(t.noop)continue;let o=r.fields[e];void 0===o?(o=r.fields[e]={noop:t.noop,record:t.record,value:t.value},r.fieldCount++):(o.noop&&r.fieldCount++,o.noop=t.noop,o.record=t.record,o.value=t.value)}}return t}},e.pop=function(t,o,n){const r=m(t,n),{split:s}=r;let a=t;for(let e=0,t=s.length;e<t;e++)a=a[s[e]];const i=M(o,t.__type__);0===i.arrayCount&&o.size++;const l={values:[],record:r,method:e.MutArrayMethod.Pop,start:-1,deleteCount:0};a.pop(),i.arrayCount++,i.array.push(l),o.touched=!0,o.size++},e.push=function(t,o,n){const r=m(t,n),{split:s}=r;let a=t;for(let e=0,t=s.length;e<t;e++)a=a[s[e]];const i=M(o,t.__type__);0===i.arrayCount&&o.size++;const l={values:[],record:r,method:e.MutArrayMethod.Push,start:-1,deleteCount:0};for(let e=3;e<arguments.length;e++){const t=arguments[e];a.push(t),l.values.push(t)}i.arrayCount++,i.array.push(l),o.touched=!0,o.size++},e.reset=function(e){for(const t in e.changes){const o=e.changes[t],{array:n,fields:r}=o;let s;for(;s=n.pop();)g.release(s);for(const e in r)r[e].noop=!0;o.fieldCount=0,o.arrayCount=0}e.size=0,e.touched=!1},e.set=function(e,t,o,n){const r=M(t,e.__type__);0===r.fieldCount&&t.size++,t.touched=!0;const s=r.fields[o],a=m(e,o);void 0!==s?(s.noop&&(s.noop=!1,r.fieldCount++),s.value=n):(r.fieldCount++,r.fields[o]={record:a,value:n,noop:!1});const{split:i}=a,l=i.length-1;let u,c=e;for(u=0;u<l;u++)c=c[i[u]];c[i[u]]=n},e.shift=function(t,o,n){const r=m(t,n),{split:s}=r;let a=t;for(let e=0,t=s.length;e<t;e++)a=a[s[e]];const i=M(o,t.__type__);0===i.arrayCount&&o.size++;const l={values:[],record:r,method:e.MutArrayMethod.Shift,start:-1,deleteCount:0};a.shift(),i.arrayCount++,i.array.push(l),o.touched=!0,o.size++},e.splice=function(t,o,n,r,s){const a=m(t,n),{split:i}=a;let l=t;for(let e=0,t=i.length;e<t;e++)l=l[i[e]];const u=M(o,t.__type__);0===u.arrayCount&&o.size++;const c={values:[],record:a,method:e.MutArrayMethod.Splice,start:r,deleteCount:s};for(let e=5;e<arguments.length;e++)c.values.push(arguments[e]);l.splice(r,s,...c.values),u.arrayCount++,u.array.push(c),o.touched=!0,o.size++},e.unshift=function(t,o,n){const r=m(t,n),{split:s}=r;let a=t;for(let e=0,t=s.length;e<t;e++)a=a[s[e]];const i=M(o,t.__type__);0===i.arrayCount&&o.size++;const l={values:[],record:r,method:e.MutArrayMethod.Unshift,start:-1,deleteCount:0};for(let e=3;e<arguments.length;e++){const t=arguments[e];a.unshift(t),l.values.push(t)}i.arrayCount++,i.array.push(l),o.touched=!0,o.size++},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Javelin={})}(this,(function(e){"use strict";function t(e,t="",n){if(!e)throw new Error(void 0!==n?`${o[n]}: ${t}`:t)}var n;!function(e){e[e.Internal=0]="Internal",e[e.Query=1]="Query"}(n||(n={}));const o={[n.Internal]:"Internal Error",[n.Query]:"Query Error"},r=Symbol("javelin_field_kind"),l=Symbol("javelin_model_flat");var s;function a(e){for(;e.length>0;)e.pop();return e}!function(e){e[e.Number=0]="Number",e[e.String=1]="String",e[e.Boolean=2]="Boolean",e[e.Array=3]="Array",e[e.Object=4]="Object",e[e.Set=5]="Set",e[e.Map=6]="Map",e[e.Dynamic=7]="Dynamic"}(s||(s={}));const i={[r]:s.Number,get:()=>0},u={[r]:s.String,get:()=>""},c={[r]:s.Boolean,get:()=>!1};function d(e){return{[r]:s.Array,get:(e=[])=>a(e),element:e}}function f(e,t=u){return{[r]:s.Object,get:(e={})=>{for(const t in e)delete e[t];return e},key:t,element:e}}function h(e=(()=>null)){return{[r]:s.Dynamic,get:e}}function p(e){return r in e}const y={path:u,field:i,split:d(u),traverse:d(u)},_={method:i,record:y,values:d(h()),start:i,deleteCount:i},g={changes:f({fields:f({noop:c,value:h(),record:y}),array:d(_),fieldCount:i,arrayCount:i}),size:i,touched:c};var v;(v=e.MutArrayMethod||(e.MutArrayMethod={}))[v.Pop=0]="Pop",v[v.Push=1]="Push",v[v.Shift=2]="Shift",v[v.Unshift=3]="Unshift",v[v.Splice=4]="Splice";const C={schemaIndex:new WeakMap,schemaPools:new Map,model:{[l]:{}},worlds:[],worldIds:0,currentWorldId:-1};var m;!function(e){e[e.Spawn=0]="Spawn",e[e.Attach=1]="Attach",e[e.Detach=2]="Detach",e[e.Mutate=3]="Mutate",e[e.Destroy=4]="Destroy"}(m||(m={}));function M(e,o,r,l){let s=0,a=null,i=e,u=C.model[e.__type__];e:for(;u.id!==o;)if(null!==a&&(i=i[a]),p(u))t("element"in u,"Failed to patch component: reached leaf before finding field"),a=r[s++],u=u.element;else for(let e=0;e<u.fields.length;e++){const t=u.fields[e];if(t.lo<=o&&t.hi>=o){a=u.keys[e],u=t;continue e}}t(null!==a,"",n.Internal),i[a]=l}const S={},z=function(e,t,n){const o=[],r=()=>{for(let t=0;t<n;t++)o.push(e(l))},l={allocate:r,retain:()=>(o.length||r(),o.pop()),release:e=>{o.push(t(e))}};return l}(()=>({method:-1,record:null,values:[],start:-1,insert:-1,deleteCount:-1}),e=>(e.method=-1,e.record=null,a(e.values),e),1e4),b=(e,n)=>{const{__type__:o}=e;let l=S[o];void 0===l&&(l=S[o]={});let a=l[n];if(void 0===a){let e=C.model[o];const i=[],u=n.split(".");for(let n=0;n<u.length;n++){const o=u[n];if(p(e))switch(e[r]){case s.Array:case s.Object:t("element"in e),e=e.element,i.push(o)}else e=e.fieldsByKey[o]}l[n]=a={traverse:i,path:n,split:u,field:e.id}}return a};function A(e,t){let n=e.changes[t];return void 0===n&&(n=e.changes[t]={fields:{},array:[],fieldCount:0,arrayCount:0}),n}e.ChangeSet=g,e.ChangeSetArrayOp=_,e.ChangeSetRecord=y,e.apply=function(e,t){if(0===e.size)return;const n=e.changes[t.__type__];if(n.fieldCount>0)for(const e in n.fields){const o=n.fields[e];if(o.noop)continue;const{record:{field:r,traverse:l},value:s}=o;M(t,r,l,s)}},e.applyPatchToComponent=M,e.copy=function(e,t){if(!1!==e.touched){t.touched=!0;for(const n in e.changes){const o=e.changes[n];if(0===o.fieldCount)continue;let r=t.changes[n];void 0===r&&(r=t.changes[n]={fields:{},array:[],fieldCount:0,arrayCount:0}),0===r.fieldCount&&t.size++;for(const e in o.fields){const t=o.fields[e];if(t.noop)continue;let n=r.fields[e];void 0===n?(n=r.fields[e]={noop:t.noop,record:t.record,value:t.value},r.fieldCount++):(n.noop&&r.fieldCount++,n.noop=t.noop,n.record=t.record,n.value=t.value)}}return t}},e.pop=function(t,n,o){const r=b(t,o),{split:l}=r;let s=t;for(let e=0,t=l.length;e<t;e++)s=s[l[e]];const a=A(n,t.__type__);0===a.arrayCount&&n.size++;const i={values:[],record:r,method:e.MutArrayMethod.Pop,start:-1,deleteCount:0};s.pop(),a.arrayCount++,a.array.push(i),n.touched=!0,n.size++},e.push=function(t,n,o){const r=b(t,o),{split:l}=r;let s=t;for(let e=0,t=l.length;e<t;e++)s=s[l[e]];const a=A(n,t.__type__);0===a.arrayCount&&n.size++;const i={values:[],record:r,method:e.MutArrayMethod.Push,start:-1,deleteCount:0};for(let e=3;e<arguments.length;e++){const t=arguments[e];s.push(t),i.values.push(t)}a.arrayCount++,a.array.push(i),n.touched=!0,n.size++},e.reset=function(e){for(const t in e.changes){const n=e.changes[t],{array:o,fields:r}=n;let l;for(;l=o.pop();)z.release(l);for(const e in r)r[e].noop=!0;n.fieldCount=0,n.arrayCount=0}e.size=0,e.touched=!1},e.set=function(e,t,n,o){const r=A(t,e.__type__);0===r.fieldCount&&t.size++,t.touched=!0;const l=r.fields[n],s=b(e,n);void 0!==l?(l.noop&&(l.noop=!1,r.fieldCount++),l.value=o):(r.fieldCount++,r.fields[n]={record:s,value:o,noop:!1});const{split:a}=s,i=a.length-1;let u,c=e;for(u=0;u<i;u++)c=c[a[u]];c[a[u]]=o},e.shift=function(t,n,o){const r=b(t,o),{split:l}=r;let s=t;for(let e=0,t=l.length;e<t;e++)s=s[l[e]];const a=A(n,t.__type__);0===a.arrayCount&&n.size++;const i={values:[],record:r,method:e.MutArrayMethod.Shift,start:-1,deleteCount:0};s.shift(),a.arrayCount++,a.array.push(i),n.touched=!0,n.size++},e.splice=function(t,n,o,r,l){const s=b(t,o),{split:a}=s;let i=t;for(let e=0,t=a.length;e<t;e++)i=i[a[e]];const u=A(n,t.__type__);0===u.arrayCount&&n.size++;const c={values:[],record:s,method:e.MutArrayMethod.Splice,start:r,deleteCount:l};for(let e=5;e<arguments.length;e++)c.values.push(arguments[e]);i.splice(r,l,...c.values),u.arrayCount++,u.array.push(c),n.touched=!0,n.size++},e.unshift=function(t,n,o){const r=b(t,o),{split:l}=r;let s=t;for(let e=0,t=l.length;e<t;e++)s=s[l[e]];const a=A(n,t.__type__);0===a.arrayCount&&n.size++;const i={values:[],record:r,method:e.MutArrayMethod.Unshift,start:-1,deleteCount:0};for(let e=3;e<arguments.length;e++){const t=arguments[e];s.unshift(t),i.values.push(t)}a.arrayCount++,a.array.push(i),n.touched=!0,n.size++},Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "@javelin/track", | ||
"version": "1.0.0-alpha.2", | ||
"version": "1.0.0-alpha.3", | ||
"main": "dist/cjs/index.js", | ||
@@ -9,5 +9,6 @@ "module": "dist/esm/index.js", | ||
"scripts": { | ||
"clean": "rm -rf dist", | ||
"perf": "node perf/index.js", | ||
"build": "tsc --project tsconfig.json && tsc --project tsconfig.cjs.json && rollup -c", | ||
"prepare": "yarn build" | ||
"prepare": "yarn clean && yarn build" | ||
}, | ||
@@ -24,7 +25,7 @@ "files": [ | ||
], | ||
"gitHead": "664507fe56e59ba2693e42f60af612ae49929c55", | ||
"gitHead": "c53cce87d5b36065814bc997a87498e35d969a04", | ||
"dependencies": { | ||
"@javelin/core": "1.0.0-alpha.1", | ||
"@javelin/ecs": "1.0.0-alpha.2" | ||
"@javelin/core": "1.0.0-alpha.3", | ||
"@javelin/ecs": "1.0.0-alpha.3" | ||
} | ||
} |
# `@javelin/track` | ||
Track changes made to Javelin components. | ||
## Docs | ||
https://javelin.games/ecs/change-detection/ | ||
## API Example | ||
```ts | ||
import * as Track from "@javelin/track" | ||
// ... | ||
const p1 = component(Position) | ||
const p2 = component(Position) | ||
const changes = component(Track.ChangeSet) | ||
// update p1 and write to ChangeSet | ||
Track.set(p1, changes, "x", 123) | ||
// apply changes to p2 | ||
Track.apply(changes, p2) | ||
p2.x // 123 | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77342
61
1047
23
1
+ Added@javelin/core@1.0.0-alpha.3(transitive)
+ Added@javelin/ecs@1.0.0-alpha.3(transitive)
- Removed@javelin/core@1.0.0-alpha.1(transitive)
- Removed@javelin/ecs@1.0.0-alpha.2(transitive)
Updated@javelin/core@1.0.0-alpha.3
Updated@javelin/ecs@1.0.0-alpha.3