vite-plugin-react-pages icon indicating copy to clipboard operation
vite-plugin-react-pages copied to clipboard

Support React 18?

Open yunsii opened this issue 2 years ago • 14 comments

Whether consider support React 18?

yunsii avatar Aug 27 '22 09:08 yunsii

Yes!

csr632 avatar Aug 27 '22 09:08 csr632

Is it coming soon? I'm using vite-plugin-react-pages to custom my starter-vite-react-library[WIP], and it's not easy to integrate with PageStrategy as my mind 😂

yunsii avatar Aug 27 '22 09:08 yunsii

What problem do you encounter with PageStrategy ? It is related to React 18? Is this doc helpful to you? https://vitejs.github.io/vite-plugin-react-pages/advanced-fs-routing (I am also planning to write Chinese translation of document: https://github.com/vitejs/vite-plugin-react-pages/issues/74)

csr632 avatar Aug 27 '22 09:08 csr632

Is it coming soon?

I expect one week of work to do the migration (React Router 6 + React 18).

csr632 avatar Aug 27 '22 09:08 csr632

What problem do you encounter with PageStrategy ? It is related to React 18?

No, just react-dom warning in console. Convention over configuration, maybe provide a official PageStrategy auto load page data is better. like: https://d.umijs.org/guide/basic

yunsii avatar Aug 27 '22 09:08 yunsii

Convention over configuration, maybe provide a official PageStrategy auto load page data is better. like: https://d.umijs.org/guide/basic

Agreed. Currently the default "convention" is only suitable for app. I should provide a PageStrategy that can be reused by library developer. dumi is indeed a great project to learn from.

csr632 avatar Aug 27 '22 09:08 csr632

Maybe I can do something for the repo, is there a roadmap?

yunsii avatar Aug 27 '22 10:08 yunsii

That would be greate! Contributions are very welcome. You can start with writing (or improve) playground and template to satisfy specific needs of users. For example, your library template would be a great demo for users that want to create a library. Currently our library template is not very practical because it doesn't include build scripts to build the library (it only have scripts to run and build demo). The demo document site is also not very practical. We can use vite-pages to build sites that has features like docusaurus.io, d.umijs.org, storybook.js.org. They are greate examples of document sites. We can also bring those feature to improve vite-pages document site. By doing that, we can know what features are missing and valuable for users, and implement them in the theme-doc or vite-pages-core. Hopefully, you will be familiar with this repo by then, and be able to implement those features! If you want to start with a concrete feature, you can try to implement docuement search in the theme doc. Anyway, your ideas and discussions about missing feature is already great help for this project!

Building this project have helped me to learn many things like vite, ssr, docusaurus, github ci...... It let me learn by implementing. Hopefully it can help you too.

is there a roadmap?

I use issues to track TODO (clear feature demand) . I have some vague ideas in my mind (such as more powerful demo rendering like storybook.js, better TS interface info extraction), but they are not clearly designed yet.

csr632 avatar Aug 27 '22 10:08 csr632

Great, start with my lib template is good idea, but there is a question, how to integrate with my template, I will improve it continuously. By init script or others?

yunsii avatar Aug 27 '22 11:08 yunsii

Great, start with my lib template is good idea, but there is a question, how to integrate with my template, I will improve it continuously. By init script or others?

You can continue improve your template in your repo. And when it is ready, we can add a build script before publishing create-vite-pages ("scripts: {"pull-template-lib": "script to pull template from you repo into this repo..."}") to pull your template into this package.

csr632 avatar Aug 27 '22 11:08 csr632

So where to place pull-template-lib script? I'm not understand.

yunsii avatar Aug 27 '22 11:08 yunsii

In the package.json of create-vite-pages:

https://github.com/vitejs/vite-plugin-react-pages/blob/main/packages/create-project/package.json

I will run the script before publishing the package.

csr632 avatar Aug 27 '22 11:08 csr632

I just updated the url in the previous comment. Sorry for the broken url 😂

csr632 avatar Aug 27 '22 11:08 csr632

Got it. I'm working on it now, the aim today is working as my expected routes 😂

yunsii avatar Aug 27 '22 12:08 yunsii

@csr632 Is it updated?

Evansy avatar Nov 03 '22 01:11 Evansy

@csr632 Is it updated?

Sorry for the delay! I haven't implement it because of lack of time. But since somebody have request for it, I will put more priority on it. I will implement this in a week.

csr632 avatar Nov 03 '22 16:11 csr632

@csr632 How long will it take for React Router 6 + React 18 to release a version,

qiaogaolong avatar Nov 07 '22 03:11 qiaogaolong

@csr632 How long will it take for React Router 6 + React 18 to release a version,

I am working on a update that:

  • upgrade react to 18.x (will fix this issue)
  • upgrade react-router to 6.x (will fix https://github.com/vitejs/vite-plugin-react-pages/issues/72)
  • upgrade mdx to 2.x (will fix https://github.com/vitejs/vite-plugin-react-pages/issues/69)

And it will be a new major version. I will release an alpha version this week.

csr632 avatar Nov 07 '22 03:11 csr632

@csr632 Thanks for your hard work,If it is successful, please tell me, I will always pay attention

qiaogaolong avatar Nov 07 '22 03:11 qiaogaolong

It's done! Currently it is published in an alpha version. Check it out: https://github.com/vitejs/vite-plugin-react-pages/pull/96

csr632 avatar Nov 13 '22 18:11 csr632