veliovgroup / flow-router

🚦 Carefully extended flow-router for Meteor
https://packosphere.com/ostrio/flow-router-extra
BSD 3-Clause "New" or "Revised" License
202 stars 29 forks source link

flow-router-extra and react-mounter #19

Closed dphov closed 6 years ago

dphov commented 7 years ago

This fork is compatible with react-mounter? After testing your fork, my application doesn't run as expected.

dr-dimitru commented 7 years ago

Hello @dphov ,

Yes, it has react helpers, see this thread, those features is not yet documented.

Let me know if it works for you.

dr-dimitru commented 7 years ago

Hello @dphov ,

Have you solved it?

dphov commented 7 years ago

Nope, think I'll need to rewrite some code because of 'react-composer'. I'll try to experiment with this.

dr-dimitru commented 7 years ago

@dphov let me know if you need to have any changes in flow-router-extra to make it compatible with react-mounter.

derwaldgeist commented 7 years ago

If I see it correctly, this router is somewhat of a community-led successor of FlowRouter, right? What makes me a bit nervous is that it is so tightly coupled with Blaze. What was the reason to include the functionality of BlazeLayout and the other Blaze helpers? TBH, I preferred the "lean approach" the old FlowRouter had. Since this one is dead, I was considering your replacement, but then I stumbled upon the missing React compatibility.

Do you have any plans to include full React support? It would be awesome if the Router would support React and Blaze alike, since this is one of the major obstacles I found when upgrading an existing Blaze app gradually to React. It would be ubercool to be able to use this router in the transition phase and beyond.

dr-dimitru commented 7 years ago

Hello @derwaldgeist ,

If I see it correctly, this router is somewhat of a community-led successor of FlowRouter, right?

We work hard to make this package better, and we glad community picked it up.

What makes me a bit nervous is that it is so tightly coupled with Blaze. What was the reason to include the functionality of BlazeLayout and the other Blaze helpers?

We made this package for our projects in a first place. In our development we don't use React, but very happy with Blaze.

I preferred the "lean approach" the old FlowRouter had. Since this one is dead, I was considering your replacement, but then I stumbled upon the missing React compatibility.

We are already thought to uncouple FlowRouter and Blaze/BlazeRenderer and wish to hear more community opinions on this.

Do you have any plans to include full React support?

Definitely - Yes. The problem is we don't use React, so we don't know its needs. We're happy to all requests like this one, where we implemented something similar to react-layout and react-mounter.

If you need us to add more helpers/methods to interact with React - tell us, but be specific.

Thank you for sharing your thoughts on this, it has big value for our Open Source projects.

derwaldgeist commented 7 years ago

@dr-dimitru Thanks a lot for your fast response and sharing these insights. Highly appreciated!

dr-dimitru commented 7 years ago

Related: https://forums.meteor.com/t/flow-router-using-react-component-causes-referenceerror/39998

macrozone commented 6 years ago

I migrated two apps to ostrio:flow-router-extra that use react-mounter and have no problem so far.

dr-dimitru commented 6 years ago

@macrozone would you contribute to our docs (see #40)? I have no experience with React+Meteor, I bet community would appreciate it much.

macrozone commented 6 years ago

@dr-dimitru i didn't change anything from standard flowrouter. This still works:

import React from 'react'
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
import { mount } from 'react-mounter';
import AboutMe from './AboutMe'

const MainLayout = ({content}) => (
    <div>
      <header>
        This is our header
      </header>
      <main>
        {content()}
      </main>
    </div>
);

 FlowRouter.route('/about-me', {
    name: 'about-me',
    action() {
      mount(MainLayout, {
        content: () => <AboutMe/>,
      });
    },
  });
dr-dimitru commented 6 years ago

@macrozone do you import mount, MainLayout, Register from somewhere? Shall we give minimal example for MainLayout and Register templates?

macrozone commented 6 years ago

@dr-dimitru for MainLayout, refer to https://github.com/kadirahq/react-mounter

i'll update the example above

dr-dimitru commented 6 years ago

Closing with v3.5.1 release, docs are available here, thanks a lot to @macrozone