Skip to content
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

Status of this project #557

Open
Yamaha32088 opened this issue Feb 21, 2023 · 16 comments
Open

Status of this project #557

Yamaha32088 opened this issue Feb 21, 2023 · 16 comments

Comments

@Yamaha32088
Copy link

Just wondering what the status of this project is? It hasn't been updated for a while and issues aren't being responded to. I assume the main developers have taken a hiatus from development of After.js.

@MatthewPattell
Copy link

I do not think that someone will continue to maintain this repository. Although the project is cool in my opinion.
I don't want it to disappear, so I try to update on our fork:
https://github.com/Lomray-Software/after.js
https://www.npmjs.com/package/@lomray/after

react-router v6 + react18.

You need to find the strength in yourself to go to streams 😄

@nimaa77
Copy link
Collaborator

nimaa77 commented Mar 30, 2023

hello everyone

what features do you guys need? I mean what should be the next features we add to the library except for upgrading the deps to latest versions (react and react-router and ...)

remix framework solves a lot of issues and has a lot of good apis that are available in react router as well, this means we can integrate them into after js. but if we just copy whatever they have, we will endup with remix again. it's like inventing the wheel from scratch

the question is what should be the goal of this project in 2023? what should be features that makes this librray different and better from other solutions around?

the only problem that I have right now is, I don't know which way should this library go. give me ideas, roadmaps, a goal

@Yamaha32088
Copy link
Author

For us just updating the dependencies would be great. We don't necessarily need a lot of features, just bug fixes and keeping up with dependency updates.

@MatthewPattell
Copy link

MatthewPattell commented Mar 31, 2023

@nimaa77 hi,

In my mind I see it like this:

  • Building the project - move away from tsdx to something like rollup, etc. (low priority, but it can be easy)
  • Support for the latest version of react-router and react (medium priority, it can be taken from our fork)
  • The most important part for us is the render to stream (high priority)
  • Update dependencies (medium priority)
  • Fix typescript errors (medium priority, it can be taken from our fork)

Ready to discuss any possibilities and offer any assistance. Therefore, the team and I would very much like the implementation of render to stream.

@nimaa77
Copy link
Collaborator

nimaa77 commented Apr 20, 2023

I'm on it 😉

@nimaa77
Copy link
Collaborator

nimaa77 commented Apr 20, 2023

so if we use React 18 it has support for React lazy and code splitting on the server with suspense

react-router (remix router) 6.4 has data routers that are SSR ready This means we can drop support for getInitialProps

the transitionBehavior prop can be removed as well, it was a workaround to control wheater you want to render the next page component while the next page data is loading or if you just want to fetch data at first and then show the next page. react-router 6.4 Awaited and Defer APIs will do this (with more control)

scrollToTop will be dropped as well (since we are going to remove getInitialProps), react-router Scroll Restoration will handle that (with way way more control 😍 - this is the best feature)

so to summerize it would be:

6 breaking changes in one release

  1. Drop Support for React 16 - Upgrade to 18
  2. Drop Support for React Router 5 - Upgrade to 6.4
  3. Drop Support for asyncComponent - Alternative: React Lazy, Suspense, React Router Lazy
  4. Drop Support for getInitialProps - Alternative: React Router Data Apis and Data Router And Loader
  5. Drop Support for transitionBehavior - Alternative Awaited and Defer
  6. 404, After.js will not come with a default 404 anymore

let me know your thoughts

@nimaa77
Copy link
Collaborator

nimaa77 commented Apr 20, 2023

we can go web server agnostic and use any web server that we want to bootstrap the server (yes this means support for edge runtimes)
having examples that show how to run Vite with after.js can be good as well
and typescript types are a mess, those can get improved as well

@nimaa77
Copy link
Collaborator

nimaa77 commented Apr 21, 2023

if you think it's a big change, maybe (it might not be possible but I will give it a try)

we can keep all the current APIs and only upgrade react and react-router dependencies, so the list of the breaking changes will become:

  1. Drop Support for React 16 - Upgrade to 18
  2. Drop Support for React Router 5 - Upgrade to 6.4

then I add new APIs (new functions and components available to import) that include all those nice features that come from react-router 6 (nested layouts, scroll restoration, defer API, loader, and ...)


if it was too much complicated to implement we can break the release into two smaller breaking ones

in the first release, we just upgrade the dependencies
in the second release, we introduce the new APIs and remove the old ones
the best case scenario is to have both of them at the same time to allow the users gradually migrate to new APIs (but this is almost impossible to do)

@MatthewPattell
Copy link

MatthewPattell commented May 15, 2023

After giving it a lot of thought, I have come to the conclusion that perhaps we don't need a remix after all. If we want to use it, we can simply go ahead and install it. Additionally, both the remix and the vite integration already exist.

I really like this project because it doesn't impose many rules and is not significantly different from a regular React SPA application. I have studied many solutions for SSR, and all of them immerse us in a sea of rules, thus limiting our freedom of action.

We have tweaked this solution a bit so that switching between spa and ssr happens without modifications. With our current implementation, it became possible to transfer the project, launch, build without pain, fear and anesthesia from SPA to SSR and back.😄

image

InitialProps - like useEffect for SPA and fetching data for SSR. It works the same in all modes.

Therefore, I believe integrating the latest versions of React and React-DOM with streaming support would be fantastic. Additionally, we could consider using the vite instead of the Razzle but I'm not sure.

I think to breathe new life with the plan above

@batusai513
Copy link

batusai513 commented May 25, 2023

@MatthewPattell @nimaa77 do you need help with this, I'm actively using this package and would like to get this updates, please let me know so we can move this forward

@MatthewPattell
Copy link

Right now, I'm torn between two options. On one hand, I want to follow this plan, but it would require project migrations, which can be more time-consuming. On the other hand, I could implement this plan, which would make the migration of existing projects easier.

Currently, I'm in the process of studying these two plans :) As they say, "the road always appears under the feet of those who walk".

PS: I would also be interested to know if there is any progress from @nimaa77 .

@MatthewPattell
Copy link

Definitely came to the conclusion that it must be vite. The only thing that slows me down is that I can't get renderToPipeableStream to work correctly with createStaticRouter. I really don't want file navigation.

There are no problems with renderToString.

@nimaa77
Copy link
Collaborator

nimaa77 commented May 30, 2023

@MatthewPattell I had some progress regarding the meta tags and head API

the biggest challenge that I have right now is that I don't know how to map the dynamic modules to the routes so we can send the <script src="path/to/dynamic/route" /> in the initial HTML that we send to the users

Does any one have any ideas about this?

@MatthewPattell
Copy link

Hi, sorry guys but I got so immersed in solving problems that I came up with my own framework😂. With your permission, I will leave the link here for study.

@golaod
Copy link

golaod commented Mar 4, 2024

Is there a chance to finish up this project to work with router 6 and react 18?
This vite template you gave is awesome but of course it does too much in a same way nextjs does. I don't like having mobx and store managers and all of that. Simple solution like getInitialData was just fine

@MatthewPattell
Copy link

@golaod The point is, you don't necessarily have to use everything shown there. Just remove MobX, store managers, and anything else you don't need. Then refer to the React Router API v6.

In short: gitInitilProps is replaced with a loader function.
Here what do you looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants