-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from SuperFlyTV/wip/big-rewrite
Major change: Timeline logic takes conflicts into account in references
- Loading branch information
Showing
74 changed files
with
9,174 additions
and
6,345 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
examples/*.js | ||
examples/*.js | ||
tests/*.js |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Publish prerelease | ||
name: Publish Nightly | ||
|
||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
|
@@ -74,6 +74,9 @@ jobs: | |
- name: Bump version and build | ||
if: ${{ steps.do-publish.outputs.publish }} | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "superflytvab" | ||
COMMIT_TIMESTAMP=$(git log -1 --pretty=format:%ct HEAD) | ||
COMMIT_DATE=$(date -d @$COMMIT_TIMESTAMP +%Y%m%d-%H%M%S) | ||
GIT_HASH=$(git rev-parse --short HEAD) | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ wallaby.conf.js | |
|
||
.DS_Store | ||
.vscode/settings.json | ||
tests/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
# Migration instructions | ||
|
||
## 8.x.x -> 9.x.x | ||
|
||
### API change | ||
|
||
- `Resolver.resolveTimeline()` and `Resolver.resolveAllStates()` have been combined into one: `resolveTimeline()`. | ||
- `Resolver.getState` has been renamed to `getResolvedState`. | ||
- `validateIdString` has been renamed to `validateReferenceString`. | ||
- `resolvedTimeline.statistics` properties have changed. | ||
|
||
```typescript | ||
// Before | ||
|
||
// Resolve the timeline | ||
const options: ResolveOptions = { | ||
time: 0, | ||
} | ||
const resolvedTimeline = Resolver.resolveTimeline(timeline, options) | ||
const resolvedStates = Resolver.resolveAllStates(resolvedTimeline) | ||
// Calculate the state at a certain time: | ||
const state = Resolver.getState(resolvedStates, 15) | ||
|
||
// After | ||
|
||
// Resolve the timeline | ||
const options: ResolveOptions = { | ||
time: 0, | ||
} | ||
const resolvedTimeline = resolveTimeline(timeline, options) | ||
// Calculate the state at a certain time: | ||
const state = getResolvedState(resolvedTimeline, 15) | ||
``` | ||
|
||
### Timeline logic change | ||
|
||
Before, references where evaluated on the original (non conflicted timeline-objects). | ||
After, the references are updated when a conflict affects the dependees. | ||
|
||
```typescript | ||
const timeline = { | ||
{id: 'A', layer: '1', enable: {start: 10, end: 100}} | ||
{id: 'B', layer: '1', enable: {start: 50, end: null}} | ||
|
||
{id: 'X', layer: '1', enable: {while: '#A'}} | ||
} | ||
|
||
// Before: | ||
// A playing at [{start: 10, end: 50 }] (interrupted by B) | ||
// B playing at [{start: 50, end: null }] | ||
// X playing at [{start: 10, end: 100 }] (still references the original times of A) | ||
|
||
// After: | ||
// A playing at [{start: 10, end: 50 }] (interrupted by B) | ||
// B playing at [{start: 50, end: null }] | ||
// X playing at [{start: 10, end: 50 }] (references the updated times of A) | ||
``` | ||
|
||
### Modified tests: | ||
|
||
- basic.test.ts: "negative length object" | ||
Instead of resolving to an instance of negative length, it resolves to a zero-length instance | ||
- basic.test.ts: "negative length object sandwich 2" | ||
Instead of resolving to an instance of negative length, it resolves to a zero-length instance | ||
- basic.test.ts: "seamless" | ||
Zero-length enables are kept as zero-length instances (before, they where removed) | ||
- various: | ||
Instance references does now contain references on the form "#ObjId", ".className", | ||
before they could be naked strings | ||
|
||
## 7.x.x -> 8.x.x | ||
|
||
This release dropped support for **Node 8**. | ||
|
||
## 6.x.x -> 7.x.x | ||
|
||
### API Change | ||
|
||
The structure of the timeline-objects has changed significantly. | ||
|
||
```typescript | ||
// Before: | ||
const beforeTL = [ | ||
{ | ||
id: 'A', | ||
trigger: { | ||
type: Timeline.Enums.TriggerType.TIME_RELATIVE, | ||
value: '#objId.start', | ||
}, | ||
duration: 60, | ||
LLayer: 1, | ||
}, | ||
{ | ||
id: 'B', | ||
trigger: { | ||
type: Timeline.Enums.TriggerType.TIME_ABSOLUTE, | ||
value: 100, | ||
}, | ||
duration: 60, | ||
LLayer: 1, | ||
}, | ||
] | ||
|
||
// After: | ||
const afterTL = [ | ||
{ | ||
id: 'A', | ||
enable: { | ||
start: '#objId.start', | ||
duration: 60, | ||
}, | ||
layer: 1, | ||
}, | ||
{ | ||
id: 'B', | ||
enable: { | ||
start: 100, | ||
duration: 60, | ||
}, | ||
layer: 1, | ||
}, | ||
] | ||
``` |
Oops, something went wrong.