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

Remove references or imports to node specific objects like process or global #37

Open
Antoniossss opened this issue Oct 1, 2020 · 3 comments

Comments

@Antoniossss
Copy link

Since it supposed to work with webpack I should be able to use it out of the box. However

npm install --save @graphy/content.ttl.read

and than in method

const reader = ttlReader();
reader.read(graphContent);
reader.on('data', console.log);

fails with

image

Also I had to add

<script> global=globalThis </script>

to the index.html as it was failing with global is undefined error

@Antoniossss
Copy link
Author

I did litle digging and found out that back in the days angular cli was shimming node specific tooling
angular/angular-cli@bd4d3c5

if i recreate node shimming with stub impl reding ttls works just fine. that means that library imports node specific things like process or global without using them.

My suggestion is to remove references to node tooling, especially global and process in modules i which they are not used directly (content ttl read is one of examples)

@Antoniossss Antoniossss changed the title How to use graphy with angular?? Remove references or imports to node specific objects like process or global Oct 1, 2020
@blake-regalia
Copy link
Owner

process is used in @graphy/core.iso.stream (a dependency of ttl.read) as a polyfill for browsers and old versions of node https://github.com/blake-regalia/graphy.js/blob/master/src/core/iso/stream.js.jmacs#L194 Next major release drops support for node.js < v12, and readable-stream has standardized .destroy in standalone package away from node core with a browser variant. So next release should avoid this particular issue. At least for v4 in the meantime there is a workaround. Thanks for posting.

@Antoniossss
Copy link
Author

Great to hear that. I am loking forward to get typed version of graphy. Keep up the good work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants