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

Abierto
#50 1 comentario 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@draedful ya está trabajando en esto.

Desde el 10/3/2025.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

enhancement

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.

Lenguaje dominante
TypeScript
Estrellas
145
Forks
12
Merge medio
1 d 14 h
PR fusionados (30 d)
43

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de gravity-ui/graph

Todos los issues de gravity-ui/graph

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.