-
Notifications
You must be signed in to change notification settings - Fork 119
types & restructure #93
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: next
Are you sure you want to change the base?
Conversation
At a glance, I agree with all the proposed changes except the one for removing |
soooo that took a few more tries and the help of a typescript expert (thx @bennypowers) ... but we now have the childrenPropertyName back and TreeModel uses 2 generics (1 for the model and one for the childPropertyName) some types are still not perfect hence there are some unknown casting + ts ignores in the code - but overall it works and the types are more detailed than on the current master IMHO this should be good enough to prepare a beta of a new major 💪 what do you think? ok to merge and then prepare a beta? |
you will need to setup to use the codespace typescript version (it's 4.5 beta) as 4.4. does not support default values in "templates/generics" via jsDoc (which is used 🙈) You can do this by opening the View -> command palette (usually shift + command + p) and typing "Typescript select typescript version" to run the typescript checking/building via the command line you can execute "npm run types"
A node needs to statically know which property contains the children. consider a Node with the model data If the type is Another angle => Typescript can not access the runtime value of PS: this was not "typed" before e.g. model and children is currently |
It worked, thanks!
While I get more joy writing javascript and appreciate not having a build step, I wonder if this is the way people write js libs nowadays...
Thanks for this effort, let's merge this and then think about what's missing for the release. The |
sounds good - will prepare a PR for the release => for lining I apparently wrote the wrong plugin name 🙈 will fix in the other PR ok? |
What I did:
Soooo this is a meatier change 😅
childrenPropertyName
option => how important is that... could not get that typed... if important might try taking another stab at itnode.all(callback, { strategy: 'foo' })
.call()
by directly calling to make the code easier to read