Giter VIP home page Giter VIP logo

Comments (12)

nikku avatar nikku commented on August 16, 2024 1

"Alternatively you'd need to split-up the extension (to be transpiled individually) and the integration into your Angular app. ..."

How can do this?

1️⃣ You create your customizations in a fork of https://github.com/bpmn-io/bpmn-js-examples/tree/master/properties-panel-extension. That project compiles JSX -> JS.

2️⃣ Consume the transpiled JS resources produced in 1️⃣ in your Angular app.

To get additional feedback on this case I'd ask you to create a topic in our forum and cross-reference this thread. Maybe users already solved this issue in a simpler manner.

from bpmn-js-examples.

nikku avatar nikku commented on August 16, 2024

Could you specify the exact project you're trying?

from bpmn-js-examples.

burn83 avatar burn83 commented on August 16, 2024

Yes. sure.

i tried to realize this one:
https://github.com/bpmn-io/bpmn-js-examples/tree/master/properties-panel-extension

but my compiler seems to need another loader for compile that row of code. It seems that i must to configure Babel aproppriately. It's correct? There is another solution more simple?

from bpmn-js-examples.

nikku avatar nikku commented on August 16, 2024

Indeed. The project uses JSX and you need to add the babel-loader to transpile it to plain javascript: https://medium.com/@sivaraj-v/basic-webpack-4-and-es5-to-es6-transpiler-using-babel-dc66e72c86c6.

from bpmn-js-examples.

burn83 avatar burn83 commented on August 16, 2024

But in my project i don't have webpack.config.js, in order to add directive about babel. I only have tsconfig.json

from bpmn-js-examples.

nikku avatar nikku commented on August 16, 2024

You do, as the error message indicates. At least it seems to be used under the hood.

What you need to enable is transpilation of JSX (inside an Angular project). Not sure how that works. Alternatively you'd need to split-up the extension (to be transpiled individually) and the integration into your Angular app.

from bpmn-js-examples.

burn83 avatar burn83 commented on August 16, 2024

"Alternatively you'd need to split-up the extension (to be transpiled individually) and the integration into your Angular app. ..."
How can do this?

from bpmn-js-examples.

burn83 avatar burn83 commented on August 16, 2024

OK ... i found a complete solution to convert SpellProps.js(x) in SpellProps.js, in pure mode.
`"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});

exports["default"] = _default;

var _propertiesPanel = require("@bpmn-io/properties-panel");
var _bpmnJsPropertiesPanel = require("bpmn-js-properties-panel");
var _react = require("react");

function _default(element) {
return [{
id: 'spell',
element: element,
component: Spell,
isEdited: _propertiesPanel.isTextFieldEntryEdited
}];
}

function Spell(props) {
var element = props.element,
id = props.id;
var modeling = (0, _bpmnJsPropertiesPanel.useService)('modeling');
var translate = (0, _bpmnJsPropertiesPanel.useService)('translate');
var debounce = (0, _bpmnJsPropertiesPanel.useService)('debounceInput');

var getValue = function getValue() {
return element.businessObject.spell || '';
};

var setValue = function setValue(value) {
return modeling.updateProperties(element, {
spell: value
});
};

return _react.createElement(_propertiesPanel.TextFieldEntry, {
id: id,
element: element,
description: translate('Apply a black magic spell'),
label: translate('Spell'),
getValue: getValue,
setValue: setValue,
debounce: debounce
});
}
`

and this is the output...

Now in browser, on the console, i find this error : " Uncaught (in promise): TypeError: Cannot add property __, object is not extensible" ... It's a bug?! or ... what?

from bpmn-js-examples.

burn83 avatar burn83 commented on August 16, 2024

image

can anyone help me?

from bpmn-js-examples.

nikku avatar nikku commented on August 16, 2024

@burn83 This looks like another Angular <-> bpmn.io tooling incompatibility issue.

Please share a codesandbox that allows us to reproduce this behavior.

We aim for compatibility with existing UI frameworks. Experience has shown that some (Angular, Vue) do interesting magic though that you may need to disable for bpmn-js to work reliably.

from bpmn-js-examples.

nikku avatar nikku commented on August 16, 2024

We plan to simplify our examples to not use JSX/transpilation anymore (#206). That should workaround most of the complications you mentioned in this issue.

from bpmn-js-examples.

minzhenyu avatar minzhenyu commented on August 16, 2024

in my project, vue2, it doesn't work
image

from bpmn-js-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.