-
Notifications
You must be signed in to change notification settings - Fork 167
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
Support preact #1
Comments
in fact you can replace the react import url to export default {
reactUrl: 'https://esm.sh/preact/compat',
reactDomUrl: 'https://esm.sh/preact/compat',
...
} but the SSR and fast refresh may break. i'm planning to use esbuild or swc instead of tsc in v0.3, also needs a stable fast refresh plugin in the new compiler, preact should be supported straightway in the future. |
Awesome. FYI preact has a hot refresh plugin too: https://github.com/JoviDeCroock/prefresh |
i see, thanks |
@ije According to Dan Abramov:
There are many frameworks that do the same thing but just with another templating library. Take Next.js, Nuxt.js and Gatsby/Gridsome and sapper. There are many things in this SSG/SSR game that are not framework dependent: Take PWA, it's just manifest attribute added to html tag, it doesn't depend necessarily on React it can be injected to final rendered html:
Take analytics for example with a simple plugin you can inject analytics to the final rendered html, whether it's rendered by React's render to string method or Preact's or Vue's. Take serverless functions, image optimization, data sourcing... Now that you are working on the compiler it would be wise to to implement architecture in a way that view layer is modulated and handles its own render to string method and rehydration. Having an architecture like that also makes it easy to support other frameworks such as I suggest renaming this issue (so it's not only limited to I think one way would be have an app.html instead of app.tsx and plugins can mount frameworks (React, Preact, Vue, etc) to app.html (similar to how sapper does it) after their relative components are rendered to strings. A sample concept would be:
after configuring plugins via P.S: Doing the architecture right is gonna save a lot of people from rewriting the same logic for another framework in Deno 🦖. |
@mohsenkhanpour interesting, it's a big challenge to implement SSR/SSG/Routing/HMR for hybrid frameworks. Aleph's goal is to implement production-ready full-stack framework with |
Yes, exactly. SSG with these libraries is mainly focused on "render to string" method which most libraries already have. It's really interesting that Aleph.js also supports markdown *.md files in pages, I suppose these markdown files are statically generated then injected to the app.tsx. I wonder if routing for these markdown pages are static or dependent on React. One idea would be to check the extension of the files in 'pages' directory and according to extension Aleph.js process these extensions through their relative plugins. However for these plugins to be able to exist, some abstractions need to be exposed via Aleph.js |
Update use-deno-hook.md
@ije Would this aliasing still work because most of the components such as links and head tag are importing directly from |
Also @mohsenkhanpour we are moving to a system like you are proposing where plugins can hook into Aleph to add support for different frameworks - or so I think. |
@shadowtime2000 nope, the custom React URL has been removed. we should implement the a framework for it. |
@ije Do you think we should start working on a framework system? Also, I think we could allow frameworks to allow passing options to them, so like with React we could allow changing the URLs of the libraries, or we could instead add aliasing to the compiler/bundler. |
I would like to use preact instead of react :-)
The text was updated successfully, but these errors were encountered: