Skip to content

Compatibility with ESM (webcomponents), using in pure js without React & NodeJS in context #50

@x-0D

Description

@x-0D

I am trying to use the @gravity-ui/graph library within a pure JavaScript environment, specifically with web components and without relying on React or NodeJS. I'm encountering challenges related to ESM compatibility.

Specific Use Case:

  • Web component-based application
  • No React framework
  • No NodeJS backend (purely front-end)
  • Using standard JavaScript modules (ESM)

Problem:

I am having trouble importing and utilizing @gravity-ui/graph within this setup. It seems there might be compatibility issues when trying to load the library as an ESM module in a browser environment without a bundler typically used in React or NodeJS projects.

Expected Behavior:

I would expect to be able to import @gravity-ui/graph directly into my web component using standard ESM import syntax and use its functionalities without requiring a complex build process or dependencies on React/NodeJS.

Possible Solutions/Requests:

  • Could you provide guidance on how to properly import and use @gravity-ui/graph in a pure JavaScript/ESM environment?
  • Are there any specific configurations or build steps required to make it compatible with web components?
  • Would it be possible to provide an ESM build of the library that is optimized for browser usage without NodeJS dependencies?
  • Example usage in pure JS (webcomponents) would be helpful.

To the Gravity-UI Team:

Thank you for your work on this library! I believe that making it more easily accessible in pure JavaScript/ESM environments would greatly expand its potential user base.

Sub-issues

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions