From 6ec61555212666d0569c37acc80c2ea4221703ff Mon Sep 17 00:00:00 2001 From: Moshe Gottlieb Date: Wed, 10 Jun 2020 13:28:37 +0200 Subject: [PATCH 1/3] added clarifications about the react+typescript (a no go, ATM) and about how to resolve `strictPropertyInitialization` --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 33ad9eb..e565ecb 100644 --- a/README.md +++ b/README.md @@ -331,7 +331,14 @@ Let me know. ## Notes +* **Known issues** + * It looks like there's an [issue](../../issues/2) with **react** apps built with something like `npx create-react-app my-app --typescript` + * **Important** -Properties that were not annonated will _not_ be loaded. -* The annonation code runs when your module is loaded, and the runtime checks run when your object constructor is running -* Doesn't work on interfaces because typescript decorators don't work on interfaces, classes are required, and must subclass `JSONObject`. + * Properties that were not annonated will _not_ be loaded. + * If you plan to use `--strictPropertyInitialization` or set it in your `tsconfig.json` file, make sure you add the ts linter annonations: `// @ts-ignore` to your properties, as typescript does not know how your properties are initialized - otherwise you'd see the compilation error: +`Property 'propertyNameHere' has no initializer and is not definitely assigned in the constructor. TS2564` +Typescript doesn't have built in support for this. +This is similar to **swift**'s built in codable support - which doesn't exist in typescript, unfortunately. + * The annonation code runs when your module is loaded, and the runtime checks run when your object constructor is running + * Doesn't work on interfaces because typescript decorators don't work on interfaces, classes are required, and must subclass `JSONObject`. From 52466cc0bf67f4d7da0aadd60ed40cee0a389fbc Mon Sep 17 00:00:00 2001 From: Moshe Gottlieb Date: Wed, 10 Jun 2020 13:30:03 +0200 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e565ecb..d15f438 100644 --- a/README.md +++ b/README.md @@ -337,7 +337,7 @@ Let me know. * **Important** * Properties that were not annonated will _not_ be loaded. * If you plan to use `--strictPropertyInitialization` or set it in your `tsconfig.json` file, make sure you add the ts linter annonations: `// @ts-ignore` to your properties, as typescript does not know how your properties are initialized - otherwise you'd see the compilation error: -`Property 'propertyNameHere' has no initializer and is not definitely assigned in the constructor. TS2564` +`Property 'propertyNameHere' has no initializer and is not definitely assigned in the constructor. TS2564` Typescript doesn't have built in support for this. This is similar to **swift**'s built in codable support - which doesn't exist in typescript, unfortunately. * The annonation code runs when your module is loaded, and the runtime checks run when your object constructor is running From c3b71c80a00b011abec8c3e680c6c76b4db0b88c Mon Sep 17 00:00:00 2001 From: Moshe Gottlieb Date: Mon, 15 Jun 2020 17:48:23 +0200 Subject: [PATCH 3/3] Set theme jekyll-theme-minimal --- _config.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 _config.yml diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..2f7efbe --- /dev/null +++ b/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-minimal \ No newline at end of file