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

未关闭
#50 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@draedful 已经在做这个了。

开始于 2025年3月10日。

评估

这个 Issue 还没有评估数据。

描述

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.

主要语言
TypeScript
星标
145
派生
12
平均合并
1 天 14 小时
30 天内合并 PR
43

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

gravity-ui/graph 的其他 Issue

查看 gravity-ui/graph 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。