-
Notifications
You must be signed in to change notification settings - Fork 42
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
Angular 13 example for Relay #515
Conversation
There is a third-party library 'time-cache' that does not have types and is causing all sorts of problems. Including some quite general types here to get it working. If successful, I'll get it submitted to DefinitelyTyped so it's a one-line install for the future and it won't need to be included in the repo.
This is a 'known' bug in a few libraries that use Angular 12. It was causing the app to not start properly but with some pretty unhelpful messaging.
Created a very much non-best practice copy of the reactjs example to connect to status nodes and send/receive messages and then display them. Quite a few polyfills and manual type definitions needed in order to get this running smoothly.
@jemboh I am getting an error. I did a fresh checkout. Best if you also add the example and the commands to test it as part of the CI so that if we change the js-waku API, we don't forget to change the example and the doc.
|
We need docs.wakuconnect.dev to have the angular doc before we can close this issue #320. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
I see that the tax is not straightforward and you have unearth some issues around types import, which is exactly what we wanted to do with this issue: ensure that js-waku can work with Angular out-of-the-box.
|
Please add this folder to the examples ci to ensure we updated if we do a breaking change on js-waku API. |
size-limit report 📦
|
I am still getting an error. I added the folder to the examples CI so you can check from the CI whether all deps are properly committed
|
I fixed the error by running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 2 fix to do before merging:
- Check my questions re
ngInit
. I am not familiar with that but it's familar to React'suseEffect
then it happen every time the component is loaded which does not make it the best place to create the Waku node - It seems that we could use a type dep at js-waku level (
bl
). It's strange. do you get the same issue when using the published js-waku package instead of local files? - I added the folder to the example CI. It takes an eternity to run the test. It is using
npm
at the moment. I think we can switch it toyarn
in a follow-up PR (or never if it does not impact the test) but we should try to keep CI execution short.
Correct. I think I know why I missed this. I never deleted the Added it back now. |
npm+angular+js-waku don't seem to play nicely together so we're using yarn instead. This means we need to check it in to the repo.
I am still surprised we need to add it at the root. What is the behaviour when using js-waku from npmjs.com? Does installing the types in the angular project work? |
I think because we're not using When it's used from The |
However, this is the 3rd time this strategy creates a problem. Ultimately, it may be better to simply use the npmjs.com package as it'll reproduce exactly how users are using the lib. Also, regarding the reasons above in favour of
So, moving forward, I propose you use the npmjs.com package in the angular example. Finally, don't forget to add a dependabot entry for the new example. |
Remaining (just for the sake of clarity):
|
Closing in favour of #549 |
Problem
As a web developer in 2022
I want to easily be able to use
js-waku
with AngularSo I can build awesome dapps with my favourite framework
Solution
Here's an example send/receive messaging implementation with Angular, similar to the ReactJS one.
Notes