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

Đang mở
#50 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@draedful đang làm issue này rồi.

Từ ngày 10/3/2025.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
145
Fork
12
Merge trung bình
1 ngày 14 giờ
Pull request đã merge (30 ngày)
43

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của gravity-ui/graph

Tất cả issue của gravity-ui/graph

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.