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

Aperta
#50 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@draedful ci sta già lavorando.

Dal 10/3/2025.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

Lingua principale
TypeScript
Stelle
145
Fork
12
Merge medio
1g 14h
PR unite (30g)
43

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di gravity-ui/graph

Tutte le issue di gravity-ui/graph

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.