Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript / tsconfig.json set "strict": true + refactor #153

Closed
vatro opened this issue Aug 28, 2022 · 3 comments · Fixed by #185
Closed

TypeScript / tsconfig.json set "strict": true + refactor #153

vatro opened this issue Aug 28, 2022 · 3 comments · Fixed by #185

Comments

@vatro
Copy link
Owner

vatro commented Aug 28, 2022

yeah 🤔... think about it: to do or not to do / why I haven't done in the first place? (I remember this was a decision though)

  • Ok, now I remember, It was because I had to add undefined to every prop union type, it was kind of annoying in the early development phase.
  • Also: Svelte development was not strict per default after Svelte 3 release, this changed recently in create-svelte.

This has to be done before next.1

@vatro vatro added this to the 1.0.0-next.X milestone Aug 28, 2022
@vatro vatro self-assigned this Aug 28, 2022
vatro pushed a commit that referenced this issue Aug 29, 2022
TODO: consider setting `"strict": true`, see #153
vatro pushed a commit that referenced this issue Aug 29, 2022
- rename interface `ITreeMember` to `ISvelthreeGLTFTreeMapMember`
- `GLTF` is now passed via constructor, e.g. `const foo: SvelthreeGLTF = new SvelthreeGLTF(loaded_gltf_file: GLTF)`
- `apply(...)` now uses a `Canvas` component reference instead of a `Canvas` DOM Element.
- various `strict: true` related changes (due to `strict: true` in the SvelteKit tests project, see also #153 )
@vatro vatro changed the title TypeScript / tsconfig.json consider setting "strict": true + refactor TypeScript / tsconfig.json set "strict": true + refactor Nov 2, 2022
@vatro vatro modified the milestones: 1.0.0-next.X, 1.0.0-next.1 Nov 2, 2022
vatro pushed a commit that referenced this issue Nov 3, 2022
vatro pushed a commit that referenced this issue Nov 17, 2022
vatro pushed a commit that referenced this issue Nov 17, 2022
vatro pushed a commit that referenced this issue Nov 17, 2022
@vatro vatro pinned this issue Nov 17, 2022
@vatro
Copy link
Owner Author

vatro commented Nov 17, 2022

Current Status

svelte-check found 0 errors, 0 warnings, and 0 hints
no eslint errors / warnings

Atm still untested!

vatro pushed a commit that referenced this issue Nov 17, 2022
Make new `store` reference available on initialization, not in a reactive statement / `onMount`.
vatro pushed a commit that referenced this issue Nov 17, 2022
vatro pushed a commit that referenced this issue Nov 17, 2022
@vatro
Copy link
Owner Author

vatro commented Nov 18, 2022

Current Status

After first tests and fixes (see above) -> looking quite good! 🤞
Continuing fixing in this thread ...

vatro pushed a commit that referenced this issue Nov 21, 2022
…153)

No `props` provided -> silent, but catch possible errors when creating new `SvelthreeProps` instance.
vatro pushed a commit that referenced this issue Nov 21, 2022
Don't create helper if there's already one (don't double create). This happened due to changed reactive conditional (removed `!light.userData.helper`)
vatro pushed a commit that referenced this issue Nov 21, 2022
…istent helper (#153)

instead log `debug` (atm) as an alternative to being silent.
vatro pushed a commit that referenced this issue Nov 21, 2022
Analog `*Light` components.
vatro pushed a commit that referenced this issue Nov 21, 2022
…xistent helper (#153)

Analog `*Light` components
vatro pushed a commit that referenced this issue Nov 21, 2022
Put `scene` in top reactive statement condition, since `scene` instance is essential / prevent obsolete `error`logging on initialization.
vatro pushed a commit that referenced this issue Nov 21, 2022
…153)

Use `$` prefixed store reference (not `store`) in these cases:
- in reactive conditions
- when setting a store value: casted to `StoreBody` -> we know the store value is truthy / not `null` because the `store` reference is truthy. REMARK: this would unfortunately be marked as `error` in `strict` mode (VS Code) / `$svelthreeStores[sti]` not recognized as truthy inside the if-statement:
```
if ($svelthreeStores[sti]) {
  $svelthreeStores[sti].foo = value
}
```
so instead we do this:
```
const store = $svelthreeStores[sti]
if (store) {
  ;($svelthreeStores[sti] as StoreBody).foo = value
}
```
vatro pushed a commit that referenced this issue Nov 21, 2022
Wasn't functioning correctly after recent changes.
vatro pushed a commit that referenced this issue Nov 23, 2022
vatro pushed a commit that referenced this issue Nov 23, 2022
vatro pushed a commit that referenced this issue Nov 23, 2022
`foo` will always be replaced by the corresponding `three.js` instance, even if it's not being used by the animation logic itself (which is unlikely but possible).
vatro pushed a commit that referenced this issue Nov 23, 2022
vatro pushed a commit that referenced this issue Nov 23, 2022
Change logging from `debug` to `info` where it makes more sense, warn only where really needed / critical., log errors.
vatro pushed a commit that referenced this issue Nov 23, 2022
vatro pushed a commit that referenced this issue Nov 23, 2022
@vatro
Copy link
Owner Author

vatro commented Nov 23, 2022

Current Status

svelte-check: OK ✔️ (no warnings / errors)
eslint: OK ✔️ (no warnings / errors)

So far, all "new" test-scenes are working as expected,

Next I need to adapt the rest of the old test-scenes + add some more, this will take a couple of days.
Will create new issues if I encounter some problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant