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

Patch libh3 to include a document undefined check #169

Merged
merged 4 commits into from
Jan 17, 2023

Conversation

4nthonylin
Copy link
Contributor

Address #117 and handles WebWorker as mentioned in #163. Note that this is a patch until #163 can be fully resolved.

@CLAassistant
Copy link

CLAassistant commented Jan 14, 2023

CLA assistant check
All committers have signed the CLA.

@nrabinowitz
Copy link
Collaborator

Thanks for submitting this - looks like a great workaround until we figure out how to upgrade emscripten.

test/test-build.js Outdated Show resolved Hide resolved
@4nthonylin
Copy link
Contributor Author

4nthonylin commented Jan 14, 2023

Just as a verification that webworker works:

// index.ts
const worker = new Worker(new URL('./worker.ts', import.meta.url), {type: "module"});
worker.onmessage = (e) => console.log(e);

worker.postMessage({type:"process_h3", value: [-120, 45]});
// worker.ts
import {latLngToCell} from "h3-js";

self.onmessage = (e) => {
    const data = e.data;

    if (data.type == "process_h3") {
        const [lng, lat] = data.value;
        self.postMessage(latLngToCell(lat, lng, 5));
    }
}
// console
MessageEvent {isTrusted: true, data: '8528ab77fffffff', origin: '', lastEventId: '', source: null}

image

@coveralls
Copy link

Pull Request Test Coverage Report for Build 3920825299

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 99.844%

Totals Coverage Status
Change from base Build 3622927368: 0.0%
Covered Lines: 529
Relevant Lines: 529

💛 - Coveralls

@nrabinowitz nrabinowitz merged commit b09bd55 into uber:master Jan 17, 2023
@nrabinowitz
Copy link
Collaborator

Thanks for contributing! I will try to push out a new release early this week.

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.

5 participants