-
Notifications
You must be signed in to change notification settings - Fork 37
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
Migrate to typescript and adjust build step / tests #211
Conversation
commit b4c435c Author: Matthias Max <[email protected]> Date: Fri Jun 2 16:10:34 2023 +0200 export Options commit 394a49e Author: Matthias Max <[email protected]> Date: Fri Jun 2 16:00:30 2023 +0200 . commit e424b3e Author: Matthias Max <[email protected]> Date: Fri Jun 2 15:58:34 2023 +0200 ci fixes commit 4980ac7 Author: Matthias Max <[email protected]> Date: Fri Jun 2 15:40:54 2023 +0200 final fixes for os tests commit 1189639 Author: Matthias Max <[email protected]> Date: Fri Jun 2 15:38:34 2023 +0200 fix react tests commit 3fbf3b1 Author: Matthias Max <[email protected]> Date: Fri Jun 2 15:12:02 2023 +0200 fix last test commit 706c3d2 Author: Matthias Max <[email protected]> Date: Fri Jun 2 00:02:28 2023 +0200 clean up files commit c3a0034 Author: Matthias Max <[email protected]> Date: Fri Jun 2 00:02:14 2023 +0200 add dist commit b808bdc Author: Matthias Max <[email protected]> Date: Thu Jun 1 23:59:18 2023 +0200 and more tests commit e2f0f9f Author: Matthias Max <[email protected]> Date: Thu Jun 1 23:54:50 2023 +0200 more tests commit 9d1587b Author: Matthias Max <[email protected]> Date: Thu Jun 1 23:43:07 2023 +0200 more tests commit c6a6970 Author: Matthias Max <[email protected]> Date: Thu Jun 1 23:10:16 2023 +0200 first working test commit 012f7c6 Merge: 9a1163a 92065ff Author: Matthias Max <[email protected]> Date: Thu Jun 1 14:13:51 2023 +0200 Merge branch 'master' of https://github.com/bitflower/feathers-reactive commit 9a1163a Author: Matthias Max <[email protected]> Date: Thu Jun 1 14:08:15 2023 +0200 . commit 77bca1d Author: Matthias Max <[email protected]> Date: Thu Jun 1 09:48:20 2023 +0200 typescript migration first step commit ad8b925 Author: Matthias Max <[email protected]> Date: Wed May 31 23:04:32 2023 +0200 fix(bundling): test 1 commit c75f28e Author: luketych <[email protected]> Date: Tue May 16 14:52:27 2023 -0700 Export changes commit 92065ff Author: Matthias Max <[email protected]> Date: Mon May 15 16:10:16 2023 +0200 fix(): set main and add module in package.json commit 3cdc993 Author: Matthias Max <[email protected]> Date: Mon May 15 16:06:40 2023 +0200 Updating dist commit 4e7fea2 Author: luketych <[email protected]> Date: Sat May 6 11:26:46 2023 -0700 Update list.js commit 9220280 Author: luketych <[email protected]> Date: Sat May 6 11:26:19 2023 -0700 Update strategies.js commit 8125d16 Author: luketych <[email protected]> Date: Sat May 6 11:26:04 2023 -0700 Update resource.js commit 7193eaf Author: luketych <[email protected]> Date: Sat May 6 11:15:15 2023 -0700 Update package.json
Hi @daffl, First of all, I hope reverting my wrong commit on Let's discuss the required next steps here. |
Awesome, thank you! I'll have a closer look next week but if everything passes and once all dependencies are updated we can totally get this out. |
Sure, let me know if it needs anything else! |
I really think this should be solved @Codeonkey. You can actually try yourself already by installing directly from the feature branch like: This version still has the Would love to have your feedback. |
@bitflower Thanks for this great work dude! It works perfectly and made my life SOOOO much simpler to make my app responsive. Super excited on how simple this library just made my life. |
@bitflower So I can answer this myself just by reading through the docs, the matcher param in the watch function allow us to handle when the event should emit or not .watch({
matcher: (query) => (post: Post) => {
return _.eq(query['belongTo'], post['belongTo'].id);
},
}) |
@bitflower After I added the feathers-reactive library, my FeathersResponse type is not working anymore, to what type is the watch() function converting the response too? Here is a screenshot of the error. Am I missing an additional step? When I add a pipe to the options, the type works fine for that payload, but when I add a pipe after the find(), my type is broken. Here is my code, what is the purpose of the pipe option in the watch function, can you maybe explain a single use case of when it will be used if it does not alter the return type or anything? Preferably I would like to remove the pipe after the find and let the pipe option return my action, or I should just understand what alterations the watch() function is doing so that I can convert my types. |
Hey @Codeonkey, I'm not so much into the original functionality of the lib. I mainly converted it to TS without changing the feature set. I guess you have to find out yourself by debugging. The least I can provide is that I've also had issues with the mode "smart". I sometimes used "always" which kinda defeats the purpose - I know. |
If you can provide a minimal repro repo I'm happy to check this out! However I donÄt have the time to re-create this myself. Thanks! |
Which version of |
Any news @Codeonkey ? |
I had a quick look this week. The code looks good, I can totally make another pass to add more of the type information. My questions in general would be if Vite is necessary in this case. It's a good tool for sure but I learned the hard way that any additional dependency will eventually cause issues. My thoughts were:
I can have a look at this as well unless there are some other reasons for sticking with Vite. |
@bitflower I haven't touched the sideline project again, I will probably be able to in a week or so. I will give an update as soon as I have one. :) |
@daffl Sure, looking back now I just thought it would be easier to setup with Are you talking about this node test runner? |
Yep, that was my thought. Now that there is a test runner built in, essentially making the setup as minimalist as possible with just the plain TypeScript build. Then this repo could also be used as a reference for future migrations. I think the test runner should work with TypeScript via |
Will have time next week (was in the middle of project handover). FYI! |
Quick confirmation from within the flight cockpit.
Thoughts @daffl ? |
Ok, I have pushed another big chunk of work! Almost all tests are passing and @daffl I have just moved with Pending: This is what the test results look like: ▶ feathers-reactive integration ▶ reactive lists
(node:17781) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. Use events.setMaxListeners() to increase limit
▶ strategy.smart (645.351542ms) ▶ strategy.always
(node:17781) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. Use events.setMaxListeners() to increase limit
▶ strategy.always (505.090583ms) ▶ reactive lists (1150.878375ms) ▶ reactive resources ▶ custom id on service ▶ custom id on params ▶ reactive resources (25.931ms) ℹ tests 95 |
This has now been published as v0.11.0. Thank you again for doing this! |
Summary
(If you have not already please refer to the contributing guideline as described
here)
Open points
.gitignore
=>dist
Other Information
Hi @daffl and @marshallswain,
as discussed this is the Typescript port of
feathers-reactive
. On my local machine it compiles and tests are running successfully.What I'm not sure about is the CI/CD pipeline requirements. I think I'd need your help to get this right. Some goes for creating the changelog with
npm run changelog
. Do I even not to run this locally?At the moment I'm still consuming the package from my projects from Github which is why the
.gitignore
file still allows thedist
folder. This will be removed in the next step.Let me know how to continue!
Thanks,
Matthias
Commit history
commit b4c435c
Author: Matthias Max [email protected]
Date: Fri Jun 2 16:10:34 2023 +0200
commit 394a49e
Author: Matthias Max [email protected]
Date: Fri Jun 2 16:00:30 2023 +0200
commit e424b3e
Author: Matthias Max [email protected]
Date: Fri Jun 2 15:58:34 2023 +0200
commit 4980ac7
Author: Matthias Max [email protected]
Date: Fri Jun 2 15:40:54 2023 +0200
commit 1189639
Author: Matthias Max [email protected]
Date: Fri Jun 2 15:38:34 2023 +0200
commit 3fbf3b1
Author: Matthias Max [email protected]
Date: Fri Jun 2 15:12:02 2023 +0200
commit 706c3d2
Author: Matthias Max [email protected]
Date: Fri Jun 2 00:02:28 2023 +0200
commit c3a0034
Author: Matthias Max [email protected]
Date: Fri Jun 2 00:02:14 2023 +0200
commit b808bdc
Author: Matthias Max [email protected]
Date: Thu Jun 1 23:59:18 2023 +0200
commit e2f0f9f
Author: Matthias Max [email protected]
Date: Thu Jun 1 23:54:50 2023 +0200
commit 9d1587b
Author: Matthias Max [email protected]
Date: Thu Jun 1 23:43:07 2023 +0200
commit c6a6970
Author: Matthias Max [email protected]
Date: Thu Jun 1 23:10:16 2023 +0200
commit 012f7c6
Merge: 9a1163a 92065ff
Author: Matthias Max [email protected]
Date: Thu Jun 1 14:13:51 2023 +0200
commit 9a1163a
Author: Matthias Max [email protected]
Date: Thu Jun 1 14:08:15 2023 +0200
commit 77bca1d
Author: Matthias Max [email protected]
Date: Thu Jun 1 09:48:20 2023 +0200
commit ad8b925
Author: Matthias Max [email protected]
Date: Wed May 31 23:04:32 2023 +0200
commit c75f28e
Author: luketych [email protected]
Date: Tue May 16 14:52:27 2023 -0700
commit 92065ff
Author: Matthias Max [email protected]
Date: Mon May 15 16:10:16 2023 +0200
commit 3cdc993
Author: Matthias Max [email protected]
Date: Mon May 15 16:06:40 2023 +0200
commit 4e7fea2
Author: luketych [email protected]
Date: Sat May 6 11:26:46 2023 -0700
commit 9220280
Author: luketych [email protected]
Date: Sat May 6 11:26:19 2023 -0700
commit 8125d16
Author: luketych [email protected]
Date: Sat May 6 11:26:04 2023 -0700
commit 7193eaf
Author: luketych [email protected]
Date: Sat May 6 11:15:15 2023 -0700