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

properties panel example should work without JSX #206

Closed
marstamm opened this issue Nov 29, 2022 · 6 comments · Fixed by #240
Closed

properties panel example should work without JSX #206

marstamm opened this issue Nov 29, 2022 · 6 comments · Fixed by #240
Assignees
Labels
spring cleaning Could be cleaned up one day

Comments

@marstamm
Copy link
Contributor

marstamm commented Nov 29, 2022

What should we do?
Change https://github.com/bpmn-io/bpmn-js-examples/tree/master/properties-panel-extension to not use JSX.

E.g.: use htm instead.

Why should we do it?

  • When using the example in a React/Angular/..., the JSX is compiled by the root application
  • This is a reoccurring issue in the forum. It hinders the getting started experience

Related to #200

@smbea smbea added the backlog Queued in backlog label Nov 30, 2022
@chilligerchief
Copy link

chilligerchief commented Feb 14, 2023

This actually hinders me from extending the properties panel in my svelte application. Do you have a working example without JSX? Or can you provide a link to the forum, where someone got it to work?

When I just return a String it works fine.
But if I can return HTML (as string) it just displays the raw HML.
If I generate the Elemente programmatically like such

  const html = document.createElement('input')
  html.type = 'text' 
  html.value = "test"
  return html 

It does not display anything. I have no experience with htm. Is there no way to use "plain" javascript to create a simple text input?

@nikku nikku added the spring cleaning Could be cleaned up one day label Feb 14, 2023
@nikku
Copy link
Member

nikku commented Feb 14, 2023

You can use tagged template literals to accomplish the same thing, no JSX required. Please checkout https://github.com/developit/htm and see if that helps you.

We aim to port this example over, but were simply not able to do so, yet.

@chilligerchief
Copy link

This works fine. However, I wonder if there is a way to do this without adding yet another dependency. But I guess this is the way the world of javascript has evolved.

@nikku
Copy link
Member

nikku commented Feb 15, 2023

You can absolutely do without an additional dependency. But it will be verbose / impossible to maintain.

@hknsrr
Copy link

hknsrr commented Apr 24, 2023

Hi,

https://forum.bpmn.io/t/entry-is-not-visible/9139/3?u=hakan_sarier

Do you have any suggestions for solving this error?

marstamm added a commit that referenced this issue May 8, 2023
This makes it easier to adopt the examples in existing Projects

closes #206
@bpmn-io-tasks bpmn-io-tasks bot added the in progress Currently worked on label May 8, 2023
@bpmn-io-tasks bpmn-io-tasks bot removed the backlog Queued in backlog label May 8, 2023
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels May 8, 2023
@marstamm
Copy link
Contributor Author

marstamm commented May 8, 2023

Hi @hknsrr ,

sorry for the late reply. There are multiple ways to create Preact components. If you don't want to use JSX, an alternative could be htm. Check out the changes in #240 to see how this would look like.

@barmac barmac closed this as completed in d8e4ece May 9, 2023
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spring cleaning Could be cleaned up one day
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants