Comments (6)
Thanks for sharing, I will have a look 👍
from form-js-examples.
Hi @DK-2013 , thanks for reporting!
Can you maybe share the errors you got? We had problems with vite
properly deduplicating preact
, that's why we ended up using webpack in our example who handles it better: #7
from form-js-examples.
I make branch with sample in fork of this repo - directory: wrapper-sample.
steps in sample:
- npm i
- npm run dev
- drug Range field to form (http://localhost:5173/)
from form-js-examples.
When checking the project out, I get the same errors as when we experimented with vite
during #6. Vite do not properly deduplicate preact
leading to the known
TypeError: Cannot read properties of undefined (reading 'context')
.
This was the reason we moved to our standard webpack
pattern. Would it be an option for you to try something else then vite
?
In the meantime, we should figure out how to properly support vite
here.
from form-js-examples.
I found this solution, but it is not applicable for libs using pattern, which implemented in properties-panel.
Current structure project is complex to change build tools (client app - wrapper lib - @bpmn-io lib), include integrate react based lib to preact.
Other side if will be impossible use vite then need impliment properties-panel or search other solution.
Anyway thank you for your carry!
from form-js-examples.
Update: I tried a couple of things in vite via resolve.alias
and the @rollup/plugin-alias
plugin to to the module replacement, without any luck so far.
The main problems remains that we bundle preact inside the properties panel, which vite can't properly replace although it's defined via config.
resolve: {
alias: [
{
find: 'preact/hooks',
replacement: path.resolve(__dirname, 'node_modules/preact/hooks/dist/hooks.module.js'),
},
{
find: 'preact/jsx-runtime',
replacement: path.resolve(__dirname, 'node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js'),
},
{
find: 'preact/jsx-dev-runtime',
replacement: path.resolve(__dirname, 'node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js'),
},
{
find: 'preact/devtools',
replacement: path.resolve(__dirname, 'node_modules/preact/devtools/dist/devtools.module.js'),
},
{
find: 'preact/debug',
replacement: path.resolve(__dirname, 'node_modules/preact/debug/dist/debug.module.js'),
},
{
find: 'preact/compat',
replacement: path.resolve(__dirname, 'node_modules/preact/compat/dist/compat.module.js'),
},
{
find: 'preact',
replacement: path.resolve(__dirname, 'node_modules/preact/dist/preact.module.js'),
}
]
}
from form-js-examples.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from form-js-examples.