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

[Chore] fix tests #2602

Merged
merged 3 commits into from
Aug 9, 2024
Merged

[Chore] fix tests #2602

merged 3 commits into from
Aug 9, 2024

Conversation

heshan0131
Copy link
Contributor

@heshan0131 heshan0131 commented Aug 8, 2024

  • Fix jest test by importing loader.gl/polyfill from esm
  • Fix browser jsdom test by importing loaders.gl/polyfill from esm
  • Import @kepler.gl src in test
  • delete unused files
  • Update jsdom

Copy link

netlify bot commented Aug 8, 2024

Deploy Preview for keplergl2 ready!

Name Link
🔨 Latest commit 6bc7004
🔍 Latest deploy log https://app.netlify.com/sites/keplergl2/deploys/66b5535139bbbf00083695b6
😎 Deploy Preview https://deploy-preview-2602--keplergl2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

'@mapbox/tiny-sdf': `${nodeModules}/@mapbox/tiny-sdf/index.cjs`,
// compile from @kepler.gl src
...RESOLVE_ALIASES,
// loaders.gl cjs bundle of polyfills is not transpiled properly, use esm instead
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless there is a bug (in which case we should report and fix it), "not transpiled properly" is probably an exaggeration, (though I understand it can feel that way when fighting through a number of build issues).

AFAIK we use conservatively chosen, highly compatible transpilation targets. But we do not transpile to pure ES5. And I believe that this is similar to e.g. mapbox.

Copy link
Contributor Author

@heshan0131 heshan0131 Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Admittedly I did not look into why the cjs build failed when installing @loaders.gl/polyfill in kepler. I just want to make the test run, and importing the ESM module is the cleanest way without changing our test.
What I observe is:

  1. @loaders.gl/polyfill@4.2.2 is installed
  2. The cjs build in dist is missing installFilePolyfills implementation, see image below.
Screenshot 2024-08-08 at 2 50 56 PM

This is not necessarily a loader.gl issue. There could be multiple reason for this. We are using yarn 1.22 and node 18 to build kepler locally, upgrading both could help. I will revisit this issue once we continue to upgrade our build enviroment

Copy link
Collaborator

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Shan He <heshan0131@gmail.com>
Signed-off-by: Shan He <heshan0131@gmail.com>
Signed-off-by: Shan He <heshan0131@gmail.com>
@heshan0131 heshan0131 merged commit bc90b0e into master Aug 9, 2024
12 checks passed
@heshan0131 heshan0131 deleted the 0807-fix-test branch August 9, 2024 15:07
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

Successfully merging this pull request may close these issues.

3 participants