RW v 3 RC & Mantine

Hi to all,

I could not wait to finally try Mantine integration so I upgraded to v3.0.0 RC to try it out. I have few findings that I would like to share and hear your opinion. Some of them are potential issues to be reported (I can report it if you confirm):

  1. Add mantine as option in CLI section of Reference docs (docs/cli-commands#setup-ui):
    This one is a low-hanging fruit but, just to remind. If needed, I can report it as issue and provide PR. Need to check docs into more detail

  2. Form approach when using mantine:
    Mantine provides own form helper that, somehow, differs from Redwood approach even it seems that both of them rely on same lib under the hood. Now, with this one I’m in doubt: from one side, when I first bump into Redwood, I was astonished by forms approach (and, in general, I like to keep things simple and as close as I can to ‘original idea’. However, it seems that Mantine forms approach is as simple as RW but, integrated better with mantine-core controls (or, from other side, mantine-core controls are better fitted to mantine-form). So, I would like to ask is some kind of rw-mantine adapter for forms (e.g. to use mantine controls on RW way) is provided with RC (or it is planned in the future) and how to get more info about it (example, tutorials, whatever).

  3. Mantine use-form hook breaks Storybook
    I bumped into this one as follow-up of previous question. So, I tried to add mantin form and controls to simple demo page (contact page from tutorial). I noticed that, when I just import useForm from Mantine (import { useForm } from '@mantine/form), page disappears from Storybook (disspears: no page in side menu, 'Couldn’t find story matching ‘pages-contactpage–generated’ error message if I try to go to link directly.

As I mentioned, I’m in love with both Redwood and Mantine so I will probably continue to dig into this topic. I will try to list any new findings in this thread, as reference. And, did I forget to say big ‘THANK YOU’ for guys that integrated Mantine into RW?

1 Like

Ok, I resolved this one: @mantine/form is not installed for web-side so I added it manually and it works now. Weird that I didn’t get any errors or warnings during SB rebuild. However, it is up to authors to decide should ‘form’ package be in default part of mantine integration or it should be added ‘per need’ (and, documented somwhere)

Hi @zbubric. Thanks for reporting your findings!

  1. Please do open a PR. It sounds pretty straight forward, so no need to open an issue first. Just make sure to write a good PR description and we should be able to merge it :slight_smile:

  2. Nothing exists right now, and nothing is on our roadmap. No pressure, or expectations, but if you wanted to experiment and see what approach you think would work best, and then write a post on the forums that would be of tremendous value to the entire community! And from there we could see if we wanted to try to provide some wrapper/adapter lib or something.

  3. Documentation could be a good first step here. Another option we could also consider is to add a prompt to the setup step, asking if forms support should be added or not. In the future that could then also install the adapter library from no2 above.

Please let us all know what you think about the steps above, and if you want to work on any of them :slight_smile:

Thanks for being a part of the community!

1 Like

Hi @Tobbe,

  1. I went to create PR but then noticed that fix is already present on Main branch (will became available on docs with 3.0.0. full release)

  2. I can try to experiment a bit and try to find some ideas. Until then, it seems that replacing ‘redwood way’ with Mantine should do the job (again, pitty for all nice rw components)

  3. Sound like a nice idea. However, since adding @mantine/form is quite trivial and usually done by people that know why they need the package, maybe just adding a note to the documentation would be easier approach (suggestion: “Mantine support does not provide Mantine’s Form support out of the box. If you need to use Mantine forms, add @mantine/form manually to your web side”

1 Like

Yeah, that’s very reasonable. Do you want to create a docs PR for that?

I can do it but, question is where to document it? As a side note on docs/cli-commands#setup-ui or there is a separate documentation for Mantine integration? I’m somehow concerned that adding such ‘integration-specific’ detail to (should be) high-level CLI docs can open a ‘pandoras box’ regarding documentation readability? However, just point me where I should add it and I will do it.

This is a very valid concern. That would have happened with auth (https://redwoodjs.com/docs/cli-commands#setup-auth), so we moved all of that to its own section instead. I think we can start with a “Usage” section in the cli docs for UI. And then if it grows too big or detailed we can extract it out to its own section later. How does that sound to you?

2 Likes

@zbubric
I am a newbie here and to Redwood forms, but when I was fighting with custom Select I did happen to find Mantine and was able to connect it to the RedwoodJS form… I had an issue with GraphQL and I have not tried it since resolving it.

But apart from that GraphQL issue it did work quite nicely. Can you explain the issue a bit (and maybe how it differs from throwing Mantine manually and using <Controller> component? Only if you think it’s useful for others…

I will be trying Mantine in 3.0 rc as well since it looks great and very complete (and is very, very customizable from what I have seen (1 component but still)).

1 Like

I’m trying to prepare a showcase project containing both ‘vanilla’ approaches (pure RW and pure Mantine Form) as well as some potential ‘adapters’ (or, at least, a starting point to play with different approaches).
Hope that I will find some time during the weekend to publish first part on github so we can use it as a base-point for further ideas and approaches.

1 Like

That sounds awesome @zbubric! Please @-me when you have something to show, I’d love to take a look

Hi guys,
just to let you know that I, beside lack of time due to regular job pressure, a bit late with this one because I bumped into some new questions, some of them mantine and form related and some are just basic stuff (that is good to refresh knowledge a bit).

As soon as I have something usable, I will share a github link

2 Likes