{"name":"@bloomberg/record-tuple-polyfill","version":"0.0.2","description":"A polyfill for the Record and Tuple Stage 2 ECMAScript proposal.","main":"lib/index.umd.js","module":"lib/index.esm.js","scripts":{"clean":"rm -rf ./lib"},"repository":{"type":"git","url":"git+https://github.com/bloomberg/record-tuple-polyfill.git"},"keywords":["record","tuple","record and tuple","polyfill","ecmascript"],"author":{"name":"Rick Button","email":"rbutton2@bloomberg.net"},"contributors":[{"name":"Robin Ricard","email":"rricard2@bloomberg.net"},{"name":"Nicolò Ribaudo","email":"nribaudo1@bloomberg.net"}],"license":"Apache-2.0","publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/bloomberg/record-tuple-polyfill/issues"},"homepage":"https://github.com/bloomberg/record-tuple-polyfill#readme","_id":"@bloomberg/record-tuple-polyfill@0.0.2","_nodeVersion":"14.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-VO0n7L4la4MGZGV8YqMKWBuFB7rn32AaNk/DO5XmP+qYYa4qIcRX3KpVhyREfuJjgDmyjFBV4F5Fg+Cf341pxw==","shasum":"129aff7fe790961e9996bfd31be286d2b77f9cc3","tarball":"http://registry-npm.ywwl.com/@bloomberg/record-tuple-polyfill/download/@bloomberg/record-tuple-polyfill-0.0.2.tgz","fileCount":4,"unpackedSize":59995,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffeEpCRA9TVsSAnZWagAA5uoQAI7q6JXnSosEwmoZV3k+\n0tElgYg8oY5mGMD6YXDRvL/cBxq+HrsnKfdRr5NF+D4PFliVQzFWYOl5X+2E\nE1yJfcVvucQ+XX1xuOav34g8IIHX0fV4YUV9/Hom5o6/BQoNYYX8ZWcyE/RI\nIya/t6CkteZ2bY+fmID1wNmwM+ljPHO+GseRzyZqrw13ZtDl5KuGXCLQKSL9\nTCEutGAqrHKixvYp5tZ80QdN6Gx6m0mc25qTlWbEWH+mSi2XbyPz+ZzO4EmJ\nmjXxX4mRv2hJSqDAbqlirp+rXHIRtXznSW1NKMXOrVGzxRQkkcexyFgvVHl0\nAsL3M99nyllBS8mu16+1QNUFNJpcjSFjnZoH7Nrahw9pQSxDgxXfTPDOCRSM\nj1ygn4ptBe0kcM10tNH4IEGw1t1pdP20mM219sKCRcMSpNXwmq8yY2DNX/8h\ntg1WSvEKtFsdzCJz8ufWCc5zbt65dsMTivn6j1UMIQNeedPjOV95RKhGG2qI\n/L6/Fq+Qou6DLa7W9nkBlr8vz30njrt6XXPzW4QVbcFy8hhhVsprLBd0eQTz\nO9ny0hI3DpaKkSc8BGtD5Jlh31JK+t+VUCzsJIf8uNVLqQu9w3NCrzmMiETf\n9WT8AkLPLpuz6zJy/nm+h/LFuPyaQMttWwJIhqxa63Qr71xGBAqr8xcBCV0w\nANrx\r\n=18MF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlEQghq6aTuBxfYYQMQvGG+SoAwnC/Ds4mZQyssmaIsgIgRXwPNEwKvjSLs/8Vp0tnosH09Y9oMrLeUOkZXDKYcno="}],"size":10840,"noattachment":false,"key":"/@bloomberg/record-tuple-polyfill/-/@bloomberg/record-tuple-polyfill-0.0.2.tgz"},"maintainers":[{"name":"bbgbuilder","email":"ossbuilder@bloomberg.net"},{"name":"bloomberg-oss","email":"opensource@bloomberg.net"},{"name":"kpfleming","email":"kevin@km6g.us"}],"_npmUser":{"name":"bbgbuilder","email":"ossbuilder@bloomberg.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/record-tuple-polyfill_0.0.2_1602085160704_0.23131013051252025"},"_hasShrinkwrap":false,"readme":"# Record & Tuple Polyfill\nThe [Record and Tuple](https://github.com/tc39/proposal-record-tuple) ECMAScript proposal introduces new deeply immutable value types to JavaScript\nthat have similar access idioms to objects and arrays.\n\nThis is an **experiemental and explicitly not production ready** polyfill for the `Record and Tuple` proposal, and a [babel](https://babeljs.io) transform to support using the literal syntax.\n\nThe polyfill and transform are **constant works in progress** and are not the source of truth for the proposal.\n\n# Requirements\n\nIn order to use the syntax transform, [babel](https://babeljs.io) must be installed with at least version `7.9.0`.\n\nIn order to use the polyfill, the environment must support `WeakMap`, [`WeakRef`, and `FinalizationRegistry`](https://github.com/tc39/proposal-weakrefs). If implementations of these features are not provided, an error will be thrown.\n\n# Installation\n\n> Note: the Babel transform described below is not currently published on NPM, [as it is awaiting review](https://github.com/babel/babel/pull/12145).\n> If you really want to try the Babel transform plugin in it's packaged state, publishing locally via [verdaccio](https://verdaccio.org/) is an excellent option.\n\nTo install the transform and polyfill:\n\n```\n# install the babel transform as a dev dependency, only needed at compile time\nnpm install -D @bloomberg/babel-plugin-proposal-record-tuple\n\n# install the polyfill as a regular dependency, needed at runtime\nnpm install --save @bloomberg/record-tuple-polyfill\n```\n\nNext, add the plugin to your `babel` configuration. Example:\n\n```json\n{\n    \"plugins\": [[\"@bloomberg/babel-plugin-proposal-record-tuple\", { \"syntaxType\": \"hash\" }]]\n}\n```\n\n> Note, the `syntaxType` option is required, and must be set to either `hash` or `bar`.\n\n# Usage\n\nIf the `babel` transform and the polyfill are setup, you can start using the `Record and Tuple` literal syntax.\n\n```js\nconsole.log(#{ a: 1 } === #{ a: 1 });\nconsole.log(#[1, 2, 3] === #[1, 2, 3]);\n```\n\nIf you want to use the Record or Tuple global objects, you can import them from the polyfill directly.\n\n```js\nimport { Record, Tuple } from \"@bloomberg/record-tuple-polyfill\";\n\nconst record = Record({ a: 1 });\nconst tuple = Tuple(1, 2, 3);\nconst array = [1,2,3];\n\nconsole.log(Record.isRecord(record));\nconsole.log(Record.keys(record));\nconsole.log(Tuple.from(array));\n```\n\n# Unsupported Features\n\n`typeof` will return an incorrect value when provided a `Record` or `Tuple`.\nThis is because the polyfill implements the proposal via [interning](https://en.wikipedia.org/wiki/String_interning) frozen objects.\n\n# Playground\n\nThe Record and Tuple polyfill has been deployed in an easy to use REPL [here](https://rickbutton.github.io/record-tuple-playground/).\n\n## Supported Environments/Browsers\n\nThe Record and Tuple polyfill requires several JavaScript features that are only available experimentally in browsers, specifically `WeakRef` and `FinalizationRegistry`.\n\nThe following environments support these experimental features out-of-the-box.\n\n| environment     | supported                                |\n|-----------------|------------------------------------------|\n| [Chrome Canary](https://www.google.com/chrome/canary/)   | :heavy_check_mark:                       |\n\n\nIn order to use these experimental features other browsers, you must run the browser/environment with specific flags:\n\n| environment     | flags                                    |\n|-----------------|------------------------------------------|\n| node            | --harmony-weak-refs                      |\n| Chrome          | --js-flags=\"--harmony-weak-refs\"         |\n| Firefox Nightly | javascript.options.experimental.weakrefs |\n","publish_time":1602085160844,"_cnpm_publish_time":1602085160844,"dist-tags":{"latest":"0.0.4"}}