{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":738584815,"defaultBranch":"master","name":"fp-ts","ownerLogin":"kblcuk","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2024-01-03T15:09:24.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/5792253?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1704299347.0","currentOid":""},"activityList":{"items":[{"before":"0fcb2e4869ee9a7c82613bc5524e70d3e0fcb2fb","after":null,"ref":"refs/heads/fix-pure-annotation-placement","pushedAt":"2024-01-03T16:29:07.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"kblcuk","name":"Alexei Mikhailov","path":"/kblcuk","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/5792253?s=80&v=4"}},{"before":"54b79b1c9037f0cefbf8007c4e01fb4ee4da597e","after":"0fcb2e4869ee9a7c82613bc5524e70d3e0fcb2fb","ref":"refs/heads/fix-pure-annotation-placement","pushedAt":"2024-01-03T15:10:07.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"kblcuk","name":"Alexei Mikhailov","path":"/kblcuk","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/5792253?s=80&v=4"},"commit":{"message":"Remove useless __PURE__ annotation\n\nIt should be placed before function invocation, but here we're just\nmapping one function to another and casting it to `any`.","shortMessageHtmlLink":"Remove useless __PURE__ annotation"}},{"before":null,"after":"54b79b1c9037f0cefbf8007c4e01fb4ee4da597e","ref":"refs/heads/fix-pure-annotation-placement","pushedAt":"2024-01-03T15:09:27.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"kblcuk","name":"Alexei Mikhailov","path":"/kblcuk","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/5792253?s=80&v=4"},"commit":{"message":"Fix __PURE__ annotation placement\n\nCurrently there are some arrow functions that have /*#__PURE__*/\nannotation before function call to identify that that function call is\nside effect free.\n\nHowever since this project is built to es5 target, which doesn't have\narrow functions support, the code is then translated into regular\nfunction that loos something like this:\n\n```\n/** @internal */\nexport var flatMapNullable = function (F, M) {\n /*#__PURE__*/ return dual(3, function (self, f, onNullable) {\n return M.flatMap(self, liftNullable(F)(f, onNullable));\n });\n};\n```\n\nHowever this makes some built tools (Vite (which uses Rollup under the\nhood) in our case) unhappy, and build produces a lot of warnings about\nthat __PURE__ annotation being in the wrong place.\n\nChecking the Rollup docs [0], it seems that pure annotation should be\nplaced right before function invocation, so in this particular case\nbetween `return` keyword and the actual function.\n\nSo this simply changes arrow functions in question to have explicit\nreturn keyword and annotation before the function call, which leaves no\ninterpretation to ts compiler, and makes our code build process\nwarning-free.\n\nThis also potentially fixes https://github.com/gcanti/fp-ts/issues/1916\n\n[0] https://rollupjs.org/configuration-options/#pure","shortMessageHtmlLink":"Fix __PURE__ annotation placement"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAD1vtC5AA","startCursor":null,"endCursor":null}},"title":"Activity ยท kblcuk/fp-ts"}