Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

是否支持 IE10+? #53

Open
aniude opened this issue Nov 4, 2024 · 13 comments
Open

是否支持 IE10+? #53

aniude opened this issue Nov 4, 2024 · 13 comments

Comments

@aniude
Copy link

aniude commented Nov 4, 2024

试了一下直接 babel, runtime 部分生成的 index.mjs 依赖的 flex-tools 不会再被编译。IE10 打开会报错。看编译后的代码是否解决方案?

@aniude
Copy link
Author

aniude commented Nov 5, 2024

看了一下 flex-tools 代码里面用了 Proxy 对象,似乎不太可能对 IE10 进行兼容了。

@aniude aniude closed this as completed Nov 5, 2024
@zhangfisher
Copy link
Owner

应该是不支持的

@aniude
Copy link
Author

aniude commented Nov 5, 2024

我看了一下,似乎用到 Proxy 的 https://github.com/search?q=repo%3Azhangfisher%2Fflex-tools%20new%20Proxy%20&type=code 几个库,似乎 voerka-i18n 均未使用到。

看样子似乎是voerka-i18n打包的时候强制依赖把其他不相关的库都引入进来了。

@aniude
Copy link
Author

aniude commented Nov 5, 2024

@zhangfisher 感觉应该还有机会可以兼容IE10+

@aniude aniude reopened this Nov 5, 2024
@zhangfisher
Copy link
Owner

理论上应该可以通过编译兼容的
问题是现在不太需要考虑了,甚至电脑上都找不到IE10了
有兴趣可以自己fork改改就行

@aniude
Copy link
Author

aniude commented Nov 5, 2024

我看了一下似乎是 tsup.config.js noExternal:['flex-tools'] 把整个 flex-tools 都加载进来了。按理改成按需加载就可以了

@zhangfisher
Copy link
Owner

没用到的会被Tree Shaking

@aniude
Copy link
Author

aniude commented Nov 7, 2024

zhangfisher/flex-tools#2

@aniude
Copy link
Author

aniude commented Nov 8, 2024

目前能发现似乎都是 flex-tools 正则表达式兼容的问题。 剩下的问题 babel 都可以解决。不过这里我也尝试用了 babel / corejs 的 polyfill, 似乎都不生效。

@zhangfisher
Copy link
Owner

建议fork一个分支

@aniude
Copy link
Author

aniude commented Nov 9, 2024

麻烦 release 一下新的 npm version.我用 IE 再测试一下能不能过

@aniude
Copy link
Author

aniude commented Nov 9, 2024

本地 跑 pnpm: build:all

@voerkai18n/runtime:build: src/scope.ts(2,10): error TS2305: Module '"flex-tools/*"' has no exported member 'isFunction'.
@voerkai18n/runtime:build: 
@voerkai18n/runtime:build: src/formatter.ts(15,10): error TS2305: Module '"flex-tools/*"' has no exported member 'isFunction'.
@voerkai18n/runtime:build: 
@voerkai18n/runtime:build: src/translate.ts(3,10): error TS2305: Module '"flex-tools/*"' has no exported member 'isFunction'.
@voerkai18n/runtime:build: 
@voerkai18n/runtime:build:  ELIFECYCLE  Command failed with exit code 1.

不确定是不是已知问题

@zhangfisher
Copy link
Owner

flex-tools有一个导出错误,已经修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants