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

Turn into module #22

Merged
merged 9 commits into from
Dec 14, 2023
Merged

Turn into module #22

merged 9 commits into from
Dec 14, 2023

Conversation

nikku
Copy link
Member

@nikku nikku commented Dec 13, 2023

This allows us to consume the library as an ES module.


If we had this, then we could likely do the following:

<html>
  <script type="module">
    import Viewer from 'https://unpkg.com/bpmn-js/@16.0.0/lib/Viewer.js';
    
    const viewer = new Viewer();
  </script>
</html>

@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Dec 13, 2023
@nikku nikku requested review from a team, marstamm and smbea and removed request for a team December 13, 2023 22:50
package.json Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@nikku nikku force-pushed the turn-into-modules branch from 9b00933 to ded4518 Compare December 14, 2023 09:35
@nikku nikku requested a review from barmac December 14, 2023 09:40
@nikku
Copy link
Member Author

nikku commented Dec 14, 2023

Updated the PR according to your comments @barmac.

@fake-join fake-join bot merged commit 055b5ca into main Dec 14, 2023
4 checks passed
@fake-join fake-join bot deleted the turn-into-modules branch December 14, 2023 09:41
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Dec 14, 2023
@nikku
Copy link
Member Author

nikku commented Dec 14, 2023

I verified the following works 🎉

<html>
  <head>
  </head>
  <body>
    <script type="module">
      import intersect from 'https://unpkg.com/path-intersection?module';

      var path0 = [ [ 'M', 0, 0 ], [ 'L', 100, 100 ] ];
      var path1 = 'M0,100L100,0';

      const intersection = intersect(path0, path1);
      // [ { x: ..., y: ..., segment1: ..., segment2: ... }, ... ]
      console.log(intersection);
    </script>
  </body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants