-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
update proxy-compare and re-export replaceNewProxy #48
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 323971e:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good to me, thanks for this great change
@hayond Please use the csb build seriously. (I mean, preferably in production, if possible.) |
ok sure, no problem, I also will write some examples in the CodeSandbox, though I don't use it very often, but I will try a more complex scenario to verify the changes. |
hi, @dai-shi I am trying use this csb in my daily work, but I got a type issue of the parameter of |
Is https://codesandbox.io/s/react-typescript-forked-qn2ssx?file=/src/App.tsx |
Ah, I see, I try your writing, it works after I make the function as any... thanks.
|
@dai-shi hihi, sorry for late response ^_^, I am stuck in my other work recently, today I continue to finish the integration of this lib, I found a error when I use codesandbox, it throws can check this demo: https://codesandbox.io/s/react-typescript-forked-8j44uu?file=/src/App.tsx |
Can you check this? https://github.com/dai-shi/proxy-memoize#importing-package |
ah, let me try, seems I didn't read doc carefully. |
@dai-shi it works with this format |
Ah, types doesn't work with hacked import path. You need to configure tsconfig. "baseUrl": ".",
"paths": {
"proxy-memoize/dist/index.modern.js": [
"node_modules/proxy-memoize/dist/src/index.d.ts"
]
} https://codesandbox.io/s/goofy-goldwasser-yfo1zl?file=/tsconfig.json If it happens with normal dev environment, we may need to look for a better solution. |
sure, for my daily usage, seems can work correctly, only found error in codesandbox, let me try more, thanks |
oh, wrong conclusion... seems my daily usage also encountered this error, I will use the format you mentioned above, and add the configuration in the |
@dai-shi can work with this usage
I think it's caused by the |
I think it's not a problem: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export The problem is a bundler (or transpiler) which doesn't support native ESM. |
yeah, maybe my working webpack version doesn't support this format, let me try the |
I think webpack uses const proxyMemoize = require('proxy-memoize'); would work with CJS and |
@dai-shi hi, I saw your updates, would you like to merge this MR to master and publish a new version as well? since I used the CSB version in my daily work for some time, me and my colleagues used for some scenarios, seems no problem, and I prepare to put my tool (based on proxy-compare) to live usage, so I'd like to use regular version instead of CSB. |
This is important to hear. |
yeah, great, thanks! |
taking the update in dai-shi/proxy-compare#41