-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[GH-788] Made the check to determine whether the current web-worker is owned by PapaParse more reliable #937
[GH-788] Made the check to determine whether the current web-worker is owned by PapaParse more reliable #937
Conversation
Hi @flakey-bit, Thanks for working on this. I see there is an issue on your patch that match our test suite broken. |
ab87cf1
to
f2fe81f
Compare
NB: I found there was an issue with my implementation so I've had another go at fixing it 🤞 - I've force-pushed to my branch, which should have updated the PR. See latest build queued here. |
I've added a test case to cover this scenario. Please take a look |
Hi @flakey-bit, Test failed on node12 which is unsuported by now. |
57dbf5c
to
76ac689
Compare
@pokoli rebase is done |
@flakey-bit Tests are still broken, could you please have a look? You can run them locally with: |
I'll take a look tomorrow. Sorry for taking up your time!
…On Fri, 10 Jun 2022, 22:39 Sergi Almacellas Abellana, < ***@***.***> wrote:
@flakey-bit <https://github.com/flakey-bit> Tests are still broken, could
you please have a look?
You can run them locally with: npm test
—
Reply to this email directly, view it on GitHub
<#937 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBVTAKGN4AJKUM6CQW4MILVOMLMNANCNFSM5YE26S3A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
…able library still targets ECMAScript 5
…ker is owned by PapaParse more reliable - this fixes mholt#788 Previously, the assumption was if we're in a web-worker AND the worker was loaded from a blob, the worker *must* be ours.
…d (this fails prior to f2fe81f) Added inside a new describe block for browser-specific tests (looks for existence of `window`). This test is browser-specific due to the way the script is being loaded into a web-worker using importScripts()
76ac689
to
085778e
Compare
@pokoli have force-pushed again.
Note I've included an additional to commit to allow the tests to use latest ECMAScript syntax (does not affect the targeting of the main library). |
@Silic0nS0ldier can you also take a look at this? The approach will likely have implications for the move to ES6 modules (#875) In particular, see the test case that this PR adds. |
@flakey-bit why is required to add the latest ECMAScript syntax? Does the test work without that? |
@pokoli the test is currently written using Could rewrite the test not to use such features, but would probably make it harder to understand. |
@flakey-bit I've lost quite a bit of context since opening #875, but I don't see any reason for this to cause problems for ES6. Not sure how relevant it will be here, but I did some work to solve the same problem with NodeJS worker threads some time ago. https://github.com/developit/web-worker/blob/9ee077b6c5df0acaf5d83d89e2087bd3a3b82b97/src/node.js#L138-L142 |
@pokoli any chance of getting a new release out to NPM? |
@flakey-bit I will prefer to wait a little if there is something else to be included on the release. |
@pokoli it would be awesome to get a release out if it's not too much trouble I know it's a bit selfish of me, but part of the reason I picked up #788 was to allow us to integrate PapaParse into our application without resorting to patch-package 🙂 |
This fixes #788
Previously, the assumption was if we're in a web-worker AND the worker was loaded from a blob, the worker must be ours.