-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
build: support preact 🥳 #7255
build: support preact 🥳 #7255
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
7c47345
to
5e200e3
Compare
@excalibot trigger release |
Coverage Report
File CoverageNo changed files found. |
@ad1992 Preview version has been shipped 🚀 |
size-limit report 📦
|
Hi @Aloento I am trying to make Preact work, however I need to set an env / window variable in PREACT to test it out and I am not familiar with PREACT, so could you tell how can I do that Code Sandbox ? I don't see any way to initialize the window variable (I was expecting index.html) but there is none in CSB started template for Preact and |
@excalibot trigger release |
@ad1992 Preview version has been shipped 🚀 |
Don't know whats going on in Preact :( |
Where is IS_PREACT defined? |
So ultimately it was all CSB due to which it wasn't working :(, tried it local and works like a charm, you just need to define @Aloento can you try once and let me if it works fine for you? Also thanks for sharing the CSB with index.html 🙏 , the default builder plate of CSB was making it hard to use index.html as I am not familiar with Preact. |
Works! |
Awesome! I will finalize the PR then and it should have Preact Support in the next release 🚀 |
@excalibot trigger release |
@ad1992 Preview version has been shipped 🚀 |
@excalibot trigger release |
@ad1992 Preview version has been shipped 🚀 |
@Aloento I have updated the approach to use
You can use the #7255 (comment) for testing |
So one downside of introducing
This would simplify everything I feel and not impact non preact users at all in any way. |
Alright after having an internal discussion with @dwelle we decided to go ahead with
|
@Aloento did you get a chance to test this? |
Yes, it works. |
Awesome, thanks for confirming :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
* build: support preact * add log * Simplify the config and generate prod and dev builds for preact * update changelog * remove logs * use env variable so its available during build time * update cl * fix
closes #5909
Since there is no
umd
build available forreact-jsxruntime
and won't be in the future as well in favor of ESM hence making the umd build work isn't possible.Hence I have created a separate dev and prod build for Preact which can be used by setting the env variable
process.env._IS_PREACT
.The host needs to set this variable to
true
for Preact projects before importing ExcalidrawWhen using
vite
, you will have to make sure the variableprocess.env.IS_PREACT
is available at runtime since Vite removes it by default, so you can update thevite
config to ensure its availableI have tested in local and it works well.
So until we ship ESM build, we can keep supporting Preact with separate build