Skip to content

Include named exports of the Viewer, NavigatedViewer & Modeler classes #945

@BrianJVarley

Description

@BrianJVarley

Describe the Bug

In Angular applications & libs, some development teams ban internal path imports from npm libraries. (no-restricted-imports). But in dmn-js lib there is no named exports for viewers only default export, which results in a long import path as - import Viewer from 'dmn-js/lib/NavigatedViewer. This gist also outlines some of the cons of using only default exports.

I'm proposing not so much a fix but just additionally exporting the viewer and modeler classes as named exports for convenience:

Pull Request: #946

Steps to Reproduce

Steps to reproduce the behaviour:

  1. Import NavigatedViewer using named import - import { NavigatedViewer } from 'dmn-js';
  2. Import is undefined, only default import exists with internal path - import Viewer from 'dmn-js/lib/NavigatedViewer

Expected Behavior

The library provides a named export for each viewer and modeler class. This is generally the norm for library imports within the Angular framework.

Environment

Please complete the following information:

  • N/A
  • N/A
  • Library version: 17.2.0

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions