-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
developmentStandard developmentStandard developmentr&d:polykey:core activity 2Cross Platform Cryptography for JavaScript PlatformsCross Platform Cryptography for JavaScript Platforms
Description
Created by @CMCDragonkai
No js-polykey cannot be used in browsers. However for NS, we may need to polyfill alot of our dependencies.
The js-polykey doesn't need to do this. But in Polykey-NativeScript we are going to we webpack5 and have to resolve some packages.
Webpack 5 no longer polyfills node core modules, but we can do it manually:
- https://github.com/Richienb/node-polyfill-webpack-plugin/blob/master/package.json
- webpack/webpack@a68426e
These are:
assert: "assert",
buffer: "buffer",
console: "console-browserify",
constants: "constants-browserify",
crypto: "crypto-browserify",
domain: "domain-browser",
events: "events",
http: "stream-http",
https: "https-browserify",
os: "os-browserify/browser",
path: "path-browserify",
punycode: "punycode",
process: "process/browser",
querystring: "querystring-es3",
stream: "stream-browserify",
_stream_duplex: "readable-stream/duplex",
_stream_passthrough: "readable-stream/passthrough",
_stream_readable: "readable-stream/readable",
_stream_transform: "readable-stream/transform",
_stream_writable: "readable-stream/writable",
string_decoder: "string_decoder",
sys: "util",
timers: "timers-browserify",
tty: "tty-browserify",
url: "url",
util: "util",
vm: "vm-browserify",
zlib: "browserify-zlib"
Some of these can be polyfilled for NS.
In other cases, we will need to write alternative implementations when they don't exist, like for example the usage of fs
- https://docs.nativescript.org/ns-framework-modules/file-system
Related:
Metadata
Metadata
Assignees
Labels
developmentStandard developmentStandard developmentr&d:polykey:core activity 2Cross Platform Cryptography for JavaScript PlatformsCross Platform Cryptography for JavaScript Platforms