lin-mt / json-schema-editor-antd

Json Schema Editor (antd)
https://lin-mt.github.io/json-schema-editor-antd/
MIT License
30 stars 11 forks source link

import_json一直在loading #7

Closed XueMeijing closed 2 years ago

XueMeijing commented 2 years ago

打开import_json弹窗的时候,它请求了几个编辑器的资源,但是国内不开代理的话加载很慢,或者以后有人内网要用啥的,用不了这个。你那边可以清空缓存测一下加载速度吗?

https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/min/vs/editor/editor.main.nls.js

image

看了钉钉的连接器,他们用的好像是ace编辑器 image

XueMeijing commented 2 years ago

monaco编辑器内部用了一个他自己的loader @monaco-editor/loader,里面会动态引入cdn的js。所以以后是否有可能更改成其他能打包成本地的编辑器?感觉react-ace还行,我另一个地方用到了,体积虽然大了一点点,但是体验还可以 image

XueMeijing commented 2 years ago

好吧,monaco-loader提供了一个使用内部npm包,不使用cdn的方法,你可以看看 https://github.com/suren-atoyan/monaco-loader/issues/14

lin-mt commented 2 years ago

之前也考虑过用 ace,奈何颜值没有 monaco 高,vscode也是用的monaco,看起来顺眼~😄cdn 的问题之前想解决,只是不知道怎么用(不知道初始化代码写在哪😳我只是个可怜的 Java 后端🥺),后面我找个时间研究下,也欢迎提交 PR 哈~😄

lin-mt commented 2 years ago

顺便问下,钉钉是用在什么地方呢,也是接口文档管理的功能吗

XueMeijing commented 2 years ago

之前也考虑过用 ace,奈何颜值没有 monaco 高,vscode也是用的monaco,看起来顺眼~😄cdn 的问题之前想解决,只是不知道怎么用(不知道初始化代码写在哪😳我只是个可怜的 Java 后端🥺),后面我找个时间研究下,也欢迎提交 PR 哈~😄

好棒,我前端都不怎么会哈哈,我有空也研究试试

XueMeijing commented 2 years ago

顺便问下,钉钉是用在什么地方呢,也是接口文档管理的功能吗

我也不清楚,是我们系统集成部调研发现的,好像是请求接口拿到A数据,然后转成B数据的结构, 你可以自己免费建个钉钉公司然后去开发者后台看一下。

image

lin-mt commented 2 years ago
image

离线的可以用了,但是控制台报错,再研究研究~

lin-mt commented 2 years ago

0.1.7 应该可以了,试试


发件人: wind X @.> 发送时间: Friday, September 2, 2022 11:37:43 AM 收件人: lin-mt/json-schema-editor-antd @.> 抄送: lin-mt @.>; Comment @.> 主题: Re: [lin-mt/json-schema-editor-antd] import_json一直在loading (Issue #7)

顺便问下,钉钉是用在什么地方呢,也是接口文档管理的功能吗

我也不清楚,是我们系统集成部调研发现的,好像是请求接口拿到A数据,然后转成B数据的结构, 你可以自己免费建个钉钉公司然后去开发者后台看一下。

[image]https://user-images.githubusercontent.com/35559153/188054226-8e1d475f-426b-43fe-a93b-d4d0f04eb25d.png

― Reply to this email directly, view it on GitHubhttps://github.com/lin-mt/json-schema-editor-antd/issues/7#issuecomment-1235032892, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AN5CQTYS6C3P3TUJDK25OF3V4FZAPANCNFSM6AAAAAAQCAACWA. You are receiving this because you commented.Message ID: @.***>

XueMeijing commented 2 years ago

大佬辛苦了,我试了下引入包可以正常使用,但是控制台会报跟上面一样的错。但是用源码run dev的时候,是正常的。另外打包后的dist/index.css没有包括antd的css,在一些没有antd的项目里使用可能会没有样式。我试过使用 https://github.com/umijs/babel-plugin-import 把.babelrc的"style"改成"css",还是打不进来。这两个问题可能都是打包产生的问题?

lin-mt commented 2 years ago

样式要单独引入


发件人: wind X @.> 发送时间: Wednesday, September 14, 2022 4:03:32 PM 收件人: lin-mt/json-schema-editor-antd @.> 抄送: lin-mt @.>; State change @.> 主题: Re: [lin-mt/json-schema-editor-antd] import_json一直在loading (Issue #7)

大佬辛苦了,我试了下引入包可以正常使用,但是控制台会报跟上面一样的错。但是用源码run dev的时候,是正常的。另外打包后的dist/index.css没有包括antd的css,在一些没有antd的项目里使用可能会没有样式。我试过使用 https://github.com/umijs/babel-plugin-import 把.babelrc的"style"改成"css",还是打不进来。这两个问题可能都是打包产生的问题?

― Reply to this email directly, view it on GitHubhttps://github.com/lin-mt/json-schema-editor-antd/issues/7#issuecomment-1246393454, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AN5CQT3AVZTWNBND7EAXYZLV6GBFJANCNFSM6AAAAAAQCAACWA. You are receiving this because you modified the open/close state.Message ID: @.***>

XueMeijing commented 1 year ago

好呢好呢,谢谢大佬~

lin-mt commented 1 year ago

在 README 有引入样式的 demo ,怕你引入整个antd 的样式,跟你说下


发件人: wind X @.> 发送时间: Thursday, September 15, 2022 10:04:25 AM 收件人: lin-mt/json-schema-editor-antd @.> 抄送: lin-mt @.>; State change @.> 主题: Re: [lin-mt/json-schema-editor-antd] import_json一直在loading (Issue #7)

好呢好呢,谢谢大佬~

― Reply to this email directly, view it on GitHubhttps://github.com/lin-mt/json-schema-editor-antd/issues/7#issuecomment-1247482246, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AN5CQT3OQN2KRU336RBKCN3V6J72TANCNFSM6AAAAAAQCAACWA. You are receiving this because you modified the open/close state.Message ID: @.***>

XueMeijing commented 1 year ago

我的意思是当作第三方包引入的时候,dist/css/index.css没有把用到antd组件的css打包进来,项目里还需要再引入一遍antd的css。本地dev的时候是正常按需引入的,在storybook上的预览demo似乎和生产引入第三方包有点区别,可能是打包配置的问题,我试着改了几处配置但是都没有生效。你有空的时候可以用create-react-app搞个demo引入schema试试。现在是下面的这种效果

https://user-images.githubusercontent.com/35559153/190305399-d6b2d0f2-7758-40bb-a8bd-20882aeb41fd.mp4

lin-mt commented 1 year ago

先按照这种方式引入吧,后续再研究下,我用的是这个脚手架构建的,你也可以研究下哈 https://github.com/arco-design/arco-cli

lin-mt commented 1 year ago

我觉得还是加个微信沟通会好点哈,如果你方便的话~

lin-mt commented 1 year ago

更新到 0.1.11,看下 README.md ,加了离线使用的说明,样式加载的还在解决

XueMeijing commented 1 year ago

好的,最近事情太多了😓 我有时间也看看那个样式打包的问题

lin-mt commented 1 year ago

样式打包的最新版本也可以了哈


发件人: wind X @.> 发送时间: Monday, September 26, 2022 1:49:42 PM 收件人: lin-mt/json-schema-editor-antd @.> 抄送: lin-mt @.>; State change @.> 主题: Re: [lin-mt/json-schema-editor-antd] import_json一直在loading (Issue #7)

好的,最近事情太多了😓 我有时间也看看那个样式打包的问题

— Reply to this email directly, view it on GitHubhttps://github.com/lin-mt/json-schema-editor-antd/issues/7#issuecomment-1257512911, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AN5CQT23TWSL7QCULKSGXLTWAE2PNANCNFSM6AAAAAAQCAACWA. You are receiving this because you modified the open/close state.Message ID: @.***>