Question: Any projects based on this that ARE trying to be complete like JSDOM?
维护者通常 17 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 20/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript, react
调研方向
这是一个探索性问题,而不是范围明确的变更,其中没有指定任何仓库文件或测试。首先检查 LinkeDOM 对 Location、navigator.clipboard 和 Document.createRange() 的处理,然后确定应由现有项目还是新的 polyfill 层来提供缺失的浏览器行为。完成这一事项需要达成一致的范围和实现计划。
由索引模型根据 Issue 内容生成。
描述
This is a cool project! Context: I'm dealing right now with trying to figure out how to have tests for React components that don't take forever to run, can live in a clean plain old node environment instead of Jest's parallel universe, use tap's API instead of the code poetry like expect(thing).toHave.something('i can never remember this junk').that.isnt.Null(), etc.
I have it working now, but the big bottleneck is jsdom. Every component test takes like 5-10 seconds to spin up, at minimum, for a test that runs in 50ms or less. If they do anything interesting with the dom (which a lot of them do), it gets much worse. I'm starting to see why jest runs tests in the parallel universe that it does.
It seems like @testing-library/react and @testing-library/userevents can almost work, but there are some missing pieces (by design, I realize). I totally understand not wanting to add those pieces to linkedom, and agree with that principle entirely.
So the question is, is there a project you're aware of that uses linkedom under the hood, but then does add that extra stuff? Some of what seem to be missing that I've run into:
- Location isn't set. (Can kinda hack around it by setting
window.locationto a URL object, which is close enough, but a proper Location polyfill would obviously be needed for anything doing actual navigation.) - Navigator has userAgent, but
navigator.clipboardis missing. - Document.createRange() returns an object that doen'st have setStart and setEnd methods.
I'm thinking it'd be possible to create a set of polyfills for all these things, and probably end up with something that would really only lack some of the finer points of JSDOM's tree structure, but still be close enough to simulate a browser for react testing.
Is someone doing this already? Or, if not, is there some reason you know of why linkedom isn't a suitable base for something like this?
Thanks!
- 主要语言
- HTML
- 星标
- 2.1k
- 派生
- 112
- 平均合并
- 11 天 1 小时
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
WebReflection/linkedom 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
WebReflection/linkedom#344 ·
维护者通常 17 天内回复
-
`TextElement.toString()` puts the element text back at the first `><` of the start tag, so an attribute value containing `><` swallows the text of `<style>`, `<script>`, `<title>` and `<textarea>`可能已有人在做 @vsolano9 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
WebReflection/linkedom#341 ·
维护者通常 17 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
WebReflection/linkedom#340 ·
维护者通常 17 天内回复
-
Element#matches() compiles the selector on every call可能已有人在做 @jonasporto 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
WebReflection/linkedom#348 ·
维护者通常 17 天内回复
-
难度 3/5 半天 新手友好度 50/100
WebReflection/linkedom#345 ·
维护者通常 17 天内回复
查看 WebReflection/linkedom 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
ranxianglei/billion-context#3583 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
bug:new
难度 2/5 1-3 小时 新手友好度 76/100
callstackincubator/simlock#673 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
lidofinance/diffyscan#239 ·
维护者通常 1 天内回复