Skip to content

Commit

Permalink
Support Jsonable Interfaces with AsJsonable (#1823)
Browse files Browse the repository at this point in the history
This is basically taking advantage of duck typing. We are generating a type we know is jsonable from the input type, but setting anything not serializable to never, which will cause compile time issues with objects of the original type.

related #1816 #136 #363 #364
  • Loading branch information
anthony-murphy committed Apr 20, 2020
1 parent ba450c8 commit ae7ea5e
Show file tree
Hide file tree
Showing 13 changed files with 3,224 additions and 48 deletions.
603 changes: 565 additions & 38 deletions lerna-package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"start": "docker-compose up",
"stop": "docker-compose down",
"stop:full": "docker-compose down && docker volume prune --force",
"test": "npm run test:mocha && npm run test:jest",
"test": "npm run test:mocha && npm run test:jest && npm run test:types",
"test:bail": "npm run test:mocha:bail && npm run test:jest:bail",
"test:ci": "npm run test:report;t1=$?;npm run test:copyresults; exit $t1",
"test:ci:coverage": "npm run test:coverage;t1=$?;npm run test:copyresults; exit $t1",
Expand All @@ -59,6 +59,7 @@
"test:mocha:bail": "lerna run test:mocha --stream",
"test:mocha:report": "lerna run test:mocha --stream --no-bail --no-sort -- -- --reporter mocha-junit-reporter --reporter-options mochaFile=nyc/mocha-junit-report.xml",
"test:report": "npm run test:mocha:report && npm run test:jest:report",
"test:types": "lerna run test:types --stream --no-bail --no-sort",
"tsc": "lerna run tsc --stream",
"watch": "concurrently \"npm run watch:tsc\" \"npm run watch:esnext\" \"npm run watch:webpack\"",
"watch:esnext": "lerna run --parallel build:esnext -- -- --watch",
Expand Down
3 changes: 1 addition & 2 deletions packages/framework/last-edited/src/lastEditedTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Licensed under the MIT License.
*/

import { Jsonable } from "@microsoft/fluid-runtime-definitions";
import { SharedSummaryBlock } from "@microsoft/fluid-shared-summary-block";
import { IComponentLastEditedTracker, ILastEditDetails } from "./interfaces";

Expand Down Expand Up @@ -36,6 +35,6 @@ export class LastEditedTracker implements IComponentLastEditedTracker {
* {@inheritDoc ILastEditedTracker.updateLastEditDetails}
*/
public updateLastEditDetails(lastEditDetails: ILastEditDetails) {
this.sharedSummaryBlock.set(this.lastEditedDetailsKey, lastEditDetails as unknown as Jsonable);
this.sharedSummaryBlock.set(this.lastEditedDetailsKey, lastEditDetails);
}
}
1 change: 1 addition & 0 deletions packages/runtime/runtime-definitions/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test-d
Loading

0 comments on commit ae7ea5e

Please sign in to comment.