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

Cannot consume BaseRenderer in a minification safe manner #617

Open
nikku opened this issue Jan 28, 2022 · 0 comments
Open

Cannot consume BaseRenderer in a minification safe manner #617

nikku opened this issue Jan 28, 2022 · 0 comments
Labels
backlog Queued in backlog bug Something isn't working spring cleaning Could be cleaned up one day

Comments

@nikku
Copy link
Member

nikku commented Jan 28, 2022

Describe the Bug

With minification active the following fails:

import inherits from 'inherits';

import BaseRenderer from 'diagram-js/lib/draw/BaseRenderer';

function MyRenderer(injector) {
  injector.invoke(BaseRenderer, this, { renderPriority: 9001 });
}

MyRenderer.$inject = [ 'injector' ];

inherits(MyRenderer, BaseRenderer);

This is due to the fact that the BaseRenderer does not ship with minification info ($inject).

Steps to Reproduce

  • Try to consume the BaseRenderer in a future proof way
  • See loading explode if the bundle is minified

The obvious workaround is to use the existing constructor call pattern; that is prone to error though as the BaseRender constructor args may change.

Expected Behavior

  • Base renderer can be consumed (injector.invoke) in a minifcation safe manner
  • Existing calling pattern (BaseRenderer.call(this, ...)) contiunes to work

Environment

  • Browser: Any
  • OS: Any
  • Library version: v7, v8.1
@nikku nikku added the bug Something isn't working label Jan 28, 2022
@pinussilvestrus pinussilvestrus added backlog Queued in backlog spring cleaning Could be cleaned up one day labels Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Queued in backlog bug Something isn't working spring cleaning Could be cleaned up one day
Development

No branches or pull requests

2 participants