question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use alternatives to nodejs modules

See original GitHub issue

Hello there!

First, let me say thanks and I love the wkx package! It works great.

One thing I ran across recently was that wkx will not compile in a react-native based project. As far as I can tell, it looks like this is due to the use of util.inherits and Buffer The react-native ecosystem does not support any nodejs runtime modules, in this case the util module and the Buffer built-in.

So I was wondering if you would be willing to swap out the node stuff for more portable alternatives like node-util-inherits and buffer instead?

If not, I suppose I could fork wkx, but it seems like a change that might benefit others as well without creating a separate repo.

Anyway, thanks for all the great work.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
kylebarroncommented, Dec 10, 2020

Why don’t you publish it as a separate module?

It is a separate module: @loaders.gl/wkt, and it supports code-splitting. Usage. Note you might need to combine with binaryToGeoJson from @loaders.gl/gis because the WKBLoader’s default output is currently only our binary format.

2reactions
superguineapigcommented, Dec 10, 2020

@jayarjo My personal reason for filing this back in 2018 was that Browserify shims nodejs Buffer with https://github.com/feross/buffer which at the time was woefully out of date with current node implementation. There was (still is) a bug with the alternate version of Buffer that would not allow wkx’s unit tests to pass. I had filed a report with the folks over there https://github.com/feross/buffer/issues/197 but it still remains open to this day.

Since it’s been several years, I have moved on from the project I was working on at the time, and haven’t had a chance to revisit the original (this) issue. (that was a React Native project)

My exchange with @kylebarron was really intriguing, and I suspect that it might be possible to completely remove the need to use browserify, however I simply haven’t had any time to look into Kyle’s suggestion either.

I’m happy to close this out if it’s no longer of interest to anyone, or if @cschwarz doesn’t want any modifications to wkx (after all, my react-native use case wasn’t really in the scope of this repo), but I’m also happy to help review PRs if they come along.

cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 alternatives to Node.js and if this makes sense - Medium
It is often used to solve problems similar to Node.js. ... of RingoJS is based on CommonJS, and you can even use some...
Read more >
alternative for module.exports - node.js - Stack Overflow
We have a lint tool that reports illegal use of the assignment expression. We can eleminate them all except for the 'module.exports =...
Read more >
Alternatives to __dirname in Node.js with ES modules
ES modules with Node.js add a new, standardized global that allows your code to run anywhere, locally or remotely.
Read more >
Alternatives for Node.js environment specific code
Alternatives for Node. js environment specific code - Software Engineering Stack Exchange. Stack Overflow for Teams – Start collaborating and ...
Read more >
Try Deno as an alternative to Node.js - Opensource.com
Deno does not use npm. It uses modules referenced as URLs or file paths. · Deno does not use package. · All async...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found