{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":754215934,"defaultBranch":"master","name":"mantine","ownerLogin":"kblcuk","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2024-02-07T16:16:37.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/5792253?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1707325968.1029131","currentOid":""},"activityList":{"items":[{"before":"0cd20b4639ab2a6413c0ca7ff5eddf9835668b27","after":"c8edb117fc0a66d321b79b42c844cb1ce8d4b1b1","ref":"refs/heads/master","pushedAt":"2024-02-07T16:16:40.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":"Set interop to 'auto' for cjs build\n\nSomething with regards to this changed in 7.3.0 release, and as a result\ncommonjs artifacts don't seem to use (or even have) `_interopDefaultLegacy`\nwhen needed.\n\nOne way this manifests is that using `` in node\nenvironment (for instance a remix.run app) crashes with\n\n```\nError: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.\n```\n\nThis is due to [`react-textarea-autosize`](https://github.com/Andarist/react-textarea-autosize)\nthat `Textarea` uses under the hood always exports itself as\n```\nexports['default'] = index;\n```\n\nAnd current commonjs of Textarea looking like\n\n```\n'use client';\n'use strict';\n\nvar React = require('react');\nvar TextareaAutosize = require('react-textarea-autosize');\n\n....\n\n const autosizeProps = shouldAutosize ? { maxRows, minRows } : {};\n return /* @__PURE__ */ React.createElement(\n InputBase.InputBase,\n {\n component: shouldAutosize ? TextareaAutosize : \"textarea\",\n\n```\n\n...we end up getting `{ default: Component }` passed to\n`React.createElement` and boom.\n\nSetting [`interop: 'auto'`](https://rollupjs.org/configuration-options/#output-interop)\nchanges the behaviour to follow the way TypeScript handles these, and\nthe compiled code with it looks like:\n\n```\n'use client';\n'use strict';\n\nvar React = require('react');\nvar TextareaAutosize = require('react-textarea-autosize');\n\n...\n\nfunction _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }\n\nvar React__default = /*#__PURE__*/_interopDefault(React);\nvar TextareaAutosize__default = /*#__PURE__*/_interopDefault(TextareaAutosize);\n\n...\n\n const autosizeProps = shouldAutosize ? { maxRows, minRows } : {};\n return /* @__PURE__ */ React__default.default.createElement(\n InputBase.InputBase,\n {\n component: shouldAutosize ? TextareaAutosize__default.default : \"textarea\",\n\n```\n\nAnd now `` doesn't crash anymore.","shortMessageHtmlLink":"Set interop to 'auto' for cjs build"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAD9KPR1gA","startCursor":null,"endCursor":null}},"title":"Activity ยท kblcuk/mantine"}