Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

[Feature] Preact Support #425

Closed
2 of 3 tasks
developit opened this issue Nov 22, 2021 · 18 comments
Closed
2 of 3 tasks

[Feature] Preact Support #425

developit opened this issue Nov 22, 2021 · 18 comments

Comments

@developit
Copy link
Collaborator

developit commented Nov 22, 2021

Preact Support

@JoviDeCroock
Copy link

preactjs/preact#3327 has been published in 10.6.0, we can also merge in the document.documentElement patch later unless we want to fix this another way?

@pspeter3
Copy link

pspeter3 commented Jan 4, 2022

I'm very excited about Preact support for Remix. What can I do to help?

@JoviDeCroock
Copy link

JoviDeCroock commented Jan 4, 2022

Hey @pspeter3 it should work as of now, the only thing we need to do different is the hydrate call. Rather than hydrate(x, document) we'll need to do

const documentElement = document.documentElement;
const apply = n => document.replaceChild(n, documentElement);
hydrate(x,  {
	childNodes: [documentElement],
	firstChild: documentElement,
	insertBefore: apply,
	appendChild: apply
}

This because of our algo getting a bit confused 😅 we're hoping to land a fix but looking into the best way currently

https://twitter.com/_developit/status/1471294946560851969

@pspeter3
Copy link

pspeter3 commented Jan 4, 2022

Thanks! Is preactjs/preact#3328 the right issue to follow from the Preact side?

@JoviDeCroock
Copy link

Well that was an initial solution but we're trying to find a smaller (and maybe in core) one

@arjunyel
Copy link
Contributor

Is there an example repo with this work around used? Preact is awesome :D

Hey @pspeter3 it should work as of now, the only thing we need to do different is the hydrate call. Rather than hydrate(x, document) we'll need to do

const documentElement = document.documentElement;
const apply = n => document.replaceChild(n, documentElement);
hydrate(x,  {
	childNodes: [documentElement],
	firstChild: documentElement,
	insertBefore: apply,
	appendChild: apply
}

This because of our algo getting a bit confused 😅 we're hoping to land a fix but looking into the best way currently

https://twitter.com/_developit/status/1471294946560851969

@phiberber
Copy link

After some hours of implementing Preact in Remix, I finally found how annoying not having access to the Bundler API can be. And even after patching Remix compiler.js file, it still didn't work because of compatibility between Preact 8 and Preact X, and I didn't manage to make Preact X work with ESBuild. It would be cool if Jovi guided us in the correct direction on implementing it in Remix, as Preact is a key factor in performance optimization.

@JoviDeCroock
Copy link

I would love to help out but we're not going to work on supporting 8 😅 else we'd be working on three major versions at once, I'll try to contribute a working example in the coming week

@JoviDeCroock
Copy link

@phiberber #1636 adds an example

@chaance chaance changed the title Preact Support [Feature] Preact Support Apr 19, 2022
@isaac-mcfadyen
Copy link

Is there any update on this? The example PR was closed with the status "we are waiting to get this natively supported".

@JoviDeCroock
Copy link

Haven't heard back about this 😅

@phiberber
Copy link

Jovi, should've waited for the official implementation before deleting the example branch, anyone can follow the commit steps though.

It has been a couple months already, I'm not even sure if this is going to be released this year, and based on this issue's activity, seems like thete is little to none demand (compared to other issues).

@kiliman
Copy link
Collaborator

kiliman commented Jul 5, 2022

I do know the Remix team really wants to make Remix front-end agnostic. Preact has always been at the top of their list. With summer vacations and the major update to React Router, I believe this work was put on hold. It should pick back up soon after the new "Remix" router lands (with the data API) and deferred support.

@Klukies
Copy link

Klukies commented Jul 8, 2022

There's also the remix routers repository, where work is being done to port react-router-dom based on the underlying @remix-run/router. I think it's currently on for Vue & Svelte is in the works.
I personally didn't commit to doing any work because of the statement made by Ryan about native support 😅.

There was also a tweet from Ryan himself playing around with Preact & HTM. He's importing what is a pre-release of the remix-router package, so I would presume there's some work that was already done.

@jacob-ebey
Copy link
Member

@LukasCornille I've done an initial pass of a Preact layer here: brophdawg11/remix-routers#19

@arjunyel
Copy link
Contributor

arjunyel commented Oct 4, 2022

@pspeter3
Copy link

What would it take to get official support at this point?

@developit
Copy link
Collaborator Author

Streaming SSR support.

@remix-run remix-run locked and limited conversation to collaborators Nov 10, 2022
@MichaelDeBoey MichaelDeBoey converted this issue into discussion #4562 Nov 10, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants