Skip to content

Commit

Permalink
refactor: use the new getVersion function (#590)
Browse files Browse the repository at this point in the history
`BpmnVisualization.getVersion` is now deprecated. Use the new function
instead.
  • Loading branch information
tbouffard authored Mar 1, 2024
1 parent 7afafce commit 8595cbf
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion demo/static/js/use-case.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class UseCase {
_displayVersionInfoInFooter() {
const footerElt = document.querySelector('footer');
if (footerElt) {
const version = this._bpmnVisualization.getVersion();
const version = bpmnvisu.getVersion();
footerElt.innerText = `bpmn-visualization@${version.lib}`;
}
}
Expand Down
4 changes: 2 additions & 2 deletions projects/javascript-vanilla-with-webpack/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BpmnVisualization, FitType } from 'bpmn-visualization';
import { BpmnVisualization, FitType, getVersion } from 'bpmn-visualization';
// this is simple example of the BPMN diagram, loaded as string. Load support provided by Webpack.
// for other load methods, see https://github.com/process-analytics/bpmn-visualization-examples
import diagram from './diagram.bpmn';
Expand Down Expand Up @@ -66,7 +66,7 @@ registry.addOverlays('Activity_083jf01',

// display the bpmn-visualization version in the footer
const footer = document.querySelector("footer");
const version = bpmnVisualization.getVersion();
const version = getVersion();
const versionAsString = `bpmn-visualization@${version.lib}`;
const dependenciesAsString = [...version.dependencies].map(([name, version]) => `${name}@${version}`).join('/');
footer.innerText = `${versionAsString} with ${dependenciesAsString}`;
4 changes: 2 additions & 2 deletions projects/typescript-vanilla-with-parcel/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mxgraph, BpmnVisualization, FitType } from "bpmn-visualization";
import { mxgraph, BpmnVisualization, FitType, getVersion } from 'bpmn-visualization';
// BPMN diagram content conveniently retrieved with parcel (as string)
// for other load methods, see https://github.com/process-analytics/bpmn-visualization-examples
import diagram from "bundle-text:./diagram.bpmn";
Expand All @@ -12,7 +12,7 @@ const bpmnVisualization = new BpmnVisualization({

// display the bpmn-visualization version in the footer
const footer = document.querySelector("footer")!;
const version = bpmnVisualization.getVersion();
const version = getVersion();
const versionAsString = `bpmn-visualization@${version.lib}`;
const dependenciesAsString = [...version.dependencies].map(([name, version]) => `${name}@${version}`).join('/');
footer.innerText = `${versionAsString} with ${dependenciesAsString} | direct usage of mxGraph@${mxgraph.mxClient.VERSION}`;
Expand Down
4 changes: 2 additions & 2 deletions projects/typescript-vanilla-with-rollup/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {BpmnVisualization} from "bpmn-visualization";
import { BpmnVisualization, getVersion } from 'bpmn-visualization';
// this is simple example of the BPMN diagram, loaded as string. Load support provided by rollup-plugin-string.
// for other load methods, see https://github.com/process-analytics/bpmn-visualization-examples
import diagram from "./diagram.bpmn";
Expand Down Expand Up @@ -82,7 +82,7 @@ registry.addOverlays('Activity_083jf01',

// display the bpmn-visualization version in the footer
const footer = document.querySelector<HTMLElement>("footer")!;
const version = bpmnVisualization.getVersion();
const version = getVersion();
const versionAsString = `bpmn-visualization@${version.lib}`;
const dependenciesAsString = [...version.dependencies].map(([name, version]) => `${name}@${version}`).join('/');
footer.innerText = `${versionAsString} with ${dependenciesAsString}`;
4 changes: 2 additions & 2 deletions projects/typescript-vanilla-with-vitejs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import './style.css';
// this is simple example of the BPMN diagram, loaded as string. The '?.raw' extension support is provided by Vite.
// for other load methods, see https://github.com/process-analytics/bpmn-visualization-examples
import diagram from './diagram.bpmn?raw';
import { BpmnVisualization, FitType, mxgraph } from 'bpmn-visualization';
import { BpmnVisualization, FitType, getVersion, mxgraph } from 'bpmn-visualization';

// instantiate BpmnVisualization, pass the container HTMLElement - present in index.html
const bpmnVisualization = new BpmnVisualization({
Expand Down Expand Up @@ -68,7 +68,7 @@ registry.addOverlays('Activity_083jf01',

// display the bpmn-visualization version in the footer
const footer = document.querySelector<HTMLElement>('footer')!;
const version = bpmnVisualization.getVersion();
const version = getVersion();
const versionAsString = `bpmn-visualization@${version.lib}`;
const dependenciesAsString = [...version.dependencies].map(([name, version]) => `${name}@${version}`).join('/');
footer.innerText = `${versionAsString} with ${dependenciesAsString} | direct usage of mxGraph@${mxgraph.mxClient.VERSION}`;

0 comments on commit 8595cbf

Please sign in to comment.