Nyantastic
Nyantastic
SSolidJS
Created by Nyantastic on 1/9/2024 in #support
Routing in SolidJS "microfrontend"
Thank you! Yes I'm gonna give up the nested router idea. I guess there are several ways to handle this "seamlessly" (if that word even exists). I'm going to try the solution you suggested on monday. Thank you guys, for your time and your help! I would have spent so much time trying to figure this out. I really appreciate!
10 replies
SSolidJS
Created by Nyantastic on 1/9/2024 in #support
Routing in SolidJS "microfrontend"
@Brendan , I tried your stackblitz example and changed a few things so that looks a bit more that what I currently have (I'm using lazy imports and navigate instead of <A> links). I don't know if it's good practice or not, but I was just curious about the differences of behaviour. With these changes, you don't need to refresh to access the nested home page, but you can access it only once (wtf 😅 i mean when you go back to home or route2, if you click on Nested again you'll have to refresh ). But then you can access the nested route2 by clicking on the link (which is now a button). https://stackblitz.com/edit/solidjs-templates-34vudk?file=src%2Fnested%2Fnested-home.tsx I don't know what to do next. Maybe if we could fix the "can access the nested home only once" thing, we could have something that works? But I don't know how to fix it though EDIT: My bad, I still have the same issue. I can navigate to nested/route2 by clicking on the link, but it matches the parent router's route when I type /base/nested/route2 in the browser. I'm sorry, I don't think this is really useful. After this, I wonder if it's still a good idea to keep trying to implement it this way. What do you think?
10 replies
SSolidJS
Created by Nyantastic on 1/9/2024 in #support
Routing in SolidJS "microfrontend"
Thank you so much for your time guys. I'm sorry I haven't tried yet, I needed to make sure I understood everything and burned out my brain 😅 I'm trying again today, I'll let you know! Thanks again, I really appreciate!
10 replies
SSolidJS
Created by Nyantastic on 1/9/2024 in #support
Routing in SolidJS "microfrontend"
Thank you! I'm going to try this right away.
10 replies
SSolidJS
Created by Nyantastic on 1/8/2024 in #support
Routing in SolidJS microfrontend
@bigmistqke thanks for your answer! I'm not sure, I think it already does... I'm sorry, I made a new post where I drew the issue because I couldn't explain well here, I didn't find how to add the pictures to the original post 😰 if you want to check it out you're more than welcome!
3 replies
SSolidJS
Created by Nyantastic on 6/19/2023 in #support
Trying to test a component containing a createResource
Thank you so much for your elaborate responses and for your time! Sorry I didn't see before. I understand better now, and yes I definitely should have paid attention to the resource being undefined. I'm gonna try all this! Thanks again!
8 replies
SSolidJS
Created by Nyantastic on 6/1/2023 in #support
Conditional fetching with createResource
Wow, it works perfectly, thank you!
5 replies
SSolidJS
Created by Nyantastic on 3/14/2023 in #support
Context store issue with array
Ok, I fixed the issue, if someday someone has the same problem: I replaced the initialization: setMyContext("myArray", [ { ...mockMyObject, }, { ...mockMyObject, }, ]); with: setMyContext("myArray", [ JSON.parse(JSON.stringify(mockMyObject)), JSON.parse(JSON.stringify(mockMyObject)), ]); I guess there are better ways to clone, but that fixed the issue.
2 replies
SSolidJS
Created by Nyantastic on 3/10/2023 in #support
Trying to update a value at index in a store array, updates all elements
Maybe useContext isn't supposed to be called twice?
13 replies
SSolidJS
Created by Nyantastic on 3/10/2023 in #support
Trying to update a value at index in a store array, updates all elements
Hi, hope you had a nice weekend! Alright, this is the codesandbox I made to try to reproduce the bug: https://codesandbox.io/p/sandbox/jovial-fast-s7z0xs?file=%2Fsrc%2FApp.tsx&selection=%5B%7B%22endColumn%22%3A63%2C%22endLineNumber%22%3A12%2C%22startColumn%22%3A63%2C%22startLineNumber%22%3A12%7D%5D I apologize, some things must have been handled very poorly, but the bug is there. I must have done something stupid to have this bug, but honestly I don't know where to look anymore. Maybe you'll spot the mistake! In my example, I just have two buttons, each one uses the context. On click on one button, the function "setAttributeAtIndex" in the context is called, with the right index, and is supposed to update the count value. I wish it would update only the one the user clicked, but it updates both counts, at both indexes.
13 replies
SSolidJS
Created by Nyantastic on 3/10/2023 in #support
Trying to update a value at index in a store array, updates all elements
That's a very good idea. I'll try that but it might take a while, I'll reach out when I have it! Thank you!
13 replies
SSolidJS
Created by Nyantastic on 3/10/2023 in #support
Trying to update a value at index in a store array, updates all elements
Seems to be better practice yes, thank you!! Sadly it didn't fix my issue 😦
13 replies
SSolidJS
Created by Nyantastic on 3/10/2023 in #support
Trying to update a value at index in a store array, updates all elements
Or did you mean that I should use Suspense instead?
13 replies
SSolidJS
Created by Nyantastic on 3/10/2023 in #support
Trying to update a value at index in a store array, updates all elements
Yes, the show is allowing me to have a loading state while i'm initializing my store, there are some async calls
13 replies
SSolidJS
Created by Nyantastic on 3/10/2023 in #support
Trying to update a value at index in a store array, updates all elements
I must have done something terribly wrong here. What bothers me is also the fact that everything was working fine when the store was global. But I wanted to change that to a context, and now I'm having those issues 🫠 I'd be eternally grateful if someone has any idea!
13 replies
SSolidJS
Created by Nyantastic on 3/10/2023 in #support
Trying to update a value at index in a store array, updates all elements
I also found something else, I don't know if it will help or make it worse: In my unit tests, I also try to call the setObjectAtIndex function, like this: context.setObjectAtIndex (mockObject, 0); expect(context.myContext.myArray).toStrictEqual([ mockObject, ]); => Before this test, the array contained only one element, another mockObject, so it should be working. => The output of the test says, among other similar things: - Symbol(solid-proxy): [Object], + Symbol(solid-proxy): [Circular], But what would that mean? Any idea?
13 replies
SSolidJS
Created by Nyantastic on 1/23/2023 in #support
Testing SolidStart routes with Vitest
Thank you so much for your fast answer! I really appreciate it 😄
4 replies
SSolidJS
Created by Nyantastic on 12/12/2022 in #support
createStore from fetched data ?
You're right. Right now I don't think I'll be having that problem, since the effect is depending on routeData, which isn't supposed to change, I guess ? But I'll pay attention. I was just wondering if it was bad practice, since I'm pretty sure I read in the documentation that createEffect wasn't supposed to be used to update state, and that I should use createMemo instead. But maybe I understood that wrong 😳
7 replies
SSolidJS
Created by Nyantastic on 12/12/2022 in #support
createStore from fetched data ?
It's working like a charm with createEffect actually, but I'd like some better practice. Any advice ?
7 replies
SSolidJS
Created by Nyantastic on 12/12/2022 in #support
createStore from fetched data ?
Thank you for answering! I've been trying to do that, but I'm not sure how to update it the right way. I think I'm not supposed to use createEffect (I've read somewhere that it wasn't supposed to be used to update states and values). Maybe with createMemo ? But how ?
7 replies