\r\n \u003CTresCanvas v-bind=\"gl\">\r\n \u003CTresPerspectiveCamera :position=\"[5, 5, 5]\" />\r\n \u003CCameraControls\r\n v-bind=\"controlsState\"\r\n ref=\"controlsRef\"\r\n :make-default=\"makeDefault\"\r\n @change=\"onChange\"\r\n @start=\"onStart\"\r\n @end=\"onEnd\"\r\n />\r\n \r\n```\r\n \r\n \r\nThat means every time these emits would be expected to fire once, they're fired 100 times:\r\n\r\n```\r\nfunction addEventListeners() {\r\n useEventListener(controlsRef.value as any, 'update', () => {\r\n emit('change', controlsRef.value)\r\n invalidateOnDemand()\r\n })\r\n useEventListener(controlsRef.value as any, 'controlend', () => emit('end', controlsRef.value))\r\n useEventListener(controlsRef.value as any, 'controlstart', () => emit('start', controlsRef.value))\r\n}\r\n```\r\n\r\nThe problem is the anonymous functions:\r\n\r\nNote: If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an addEventListener call, the second function will also be added to the list of event listeners for that target.\r\n\r\nIndeed, anonymous functions are not identical even if defined using the same unchanging source-code called repeatedly, even if in a loop.\r\n\r\nRepeatedly defining the same unnamed function in such cases can be problematic. (See Memory issues, below.)\r\n\r\nhttps://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\r\nMDN Web Docs\r\n[EventTarget: addEventListener() method - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)\r\nThe addEventListener() method of the EventTarget interface\r\nsets up a function that will be called whenever the specified event is delivered to the target.\r\n\r\n### Reproduction\r\n\r\nN/A\r\n\r\n### Steps to reproduce\r\n\r\n_No response_\r\n\r\n### System Info\r\n\r\n_No response_\r\n\r\n### Used Package Manager\r\n\r\nnpm\r\n\r\n### Code of Conduct\r\n\r\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/cientos/blob/main/CODE_OF_CONDUCT.md)\r\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/cientos/blob/main/CONTRIBUTING.md).\r\n- [X] Read the [docs](https://cientos.tresjs.org/guide).\r\n- [X] Check that there isn't [already an issue](https://github.com/Tresjs/cientos/issues) that reports the same bug to avoid creating a duplicate.\r\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[3053,3056],{"name":3054,"color":3055},"bug","d73a4a",{"name":3057,"color":3058},"p3-minor-bug","F28C37",457,"useEventListener bug in controls","2024-07-24T06:42:25Z","https://github.com/Tresjs/cientos/issues/457",0.7203072,{"description":3065,"labels":3066,"number":3071,"owner":3021,"repository":3072,"state":3023,"title":3073,"updated_at":3074,"url":3075,"score":3076},"## Problem\r\n\r\nOpening a link in a new tab causes TresCanvas with manual rendering to be blank.\r\n\r\nhttps://github.com/Tresjs/tres/assets/20469369/382e1c7f-c6e9-42f1-9136-d829032ff7b5\r\n\r\n\r\n### Reproduction\r\n\r\nN/A\r\n\r\n### Steps to reproduce\r\n\r\n* `pnpm run playground`\r\n* Navigate to http://localhost:5173/\r\n* Ctrl/Command + click \"Manual rendering\" to open in a new tab\r\n* Wait a moment ~ 2 seconds\r\n* Switch to new tab\r\n\r\n### System Info\r\n\r\n```shell\r\nTested in latest Chrome and FF on Mac.\r\n```\r\n\r\n\r\n### Used Package Manager\r\n\r\npnpm\r\n\r\n### Code of Conduct\r\n\r\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/tres/blob/main/CODE_OF_CONDUCT.md)\r\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/tres/blob/main/CONTRIBUTING.md).\r\n- [X] Read the [docs](https://tresjs.org/guide).\r\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/tres/issues) that reports the same bug to avoid creating a duplicate.\r\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[3067,3068],{"name":3054,"color":3055},{"name":3069,"color":3070},"p2-edge-case","ABCC40",720,"tres","Manual rendering (edge case): canvases loaded into new tabs are initially blank","2024-06-04T20:56:47Z","https://github.com/Tresjs/tres/issues/720",0.7420094,{"description":3078,"labels":3079,"number":3084,"owner":3021,"repository":3085,"state":3023,"title":3086,"updated_at":3087,"url":3088,"score":3089},"### Describe the bug\n\nWhile working on the `Joint` I wanted to reproduce the same custom collider exportation, and when I wanted to watch the `Joint` props, I wasn't able to do so...\r\n\r\nI figured that the Vue component `setup function` needs a `Proxy` as the first parameter to **reflect** changes and here:\r\nhttps://github.com/Tresjs/rapier/blob/main/src/components/colliders/index.ts#L29-L42\r\n```ts\r\nprops: {\r\n ...BaseCollider.props,\r\n shape: undefined,\r\n },\r\n setup(props, ctx) {\r\n return {\r\n ...BaseCollider?.setup?.(\r\n { ...props, shape } as Parameters\u003C\r\n Exclude\u003C(typeof BaseCollider)['setup'], undefined>\r\n >['0'],\r\n ctx,\r\n ),\r\n }\r\n },\r\n```\r\n\r\nWe are destructing it which is equivalent to passing a native `Object`\n\n### Reproduction\n\n---\n\n### Steps to reproduce\n\n---\n\n### System Info\n\n```shell\n---\n```\n\n\n### Used Package Manager\n\nnpm\n\n### Code of Conduct\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/rapier/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/rapier/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://rapier.tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/Tresjs/rapier/issues) that reports the same bug to avoid creating a duplicate.\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[3080,3081],{"name":3054,"color":3055},{"name":3082,"color":3083},"collider","306B60",149,"rapier","Bug: custom collider props are not reactive anymore.","2024-11-19T23:52:46Z","https://github.com/Tresjs/rapier/issues/149",0.7521243,{"description":3091,"labels":3092,"number":3097,"owner":3021,"repository":3072,"state":3098,"title":3099,"updated_at":3100,"url":3101,"score":3102},"### Describe the bug\n\nReported by Guillaume Leo on discord:\r\n\r\n- Object prop is not reactive\r\n- Conditional rendering is not working. `v-if` \r\n\r\nhttps://discord.com/channels/1047126995424780288/1193882152811642892\n\n### Reproduction\n\nhttps://stackblitz.com/fork/github/stackblitz/starters/tree/main/tres?title=TresJS&description=Quick%20start%20repo%20for%20Tres.js%20projects\n\n### Steps to reproduce\n\n_No response_\n\n### System Info\n\n_No response_\n\n### Used Package Manager\n\nnpm\n\n### Code of Conduct\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/tres/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/tres/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/tres/issues) that reports the same bug to avoid creating a duplicate.\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[3093,3094],{"name":3054,"color":3055},{"name":3095,"color":3096},"v4","7980EA",503,"closed","Conditional and dynamic rendering of primitives.","2024-05-30T06:40:39Z","https://github.com/Tresjs/tres/issues/503",0.65649813,{"description":3104,"labels":3105,"number":3109,"owner":3021,"repository":3072,"state":3098,"title":3110,"updated_at":3111,"url":3112,"score":3113},"### Describe the bug\n\nWe should automatically invalidate when useTexture resolves the textures fetching. Is not really noticeable on the reproduction but I have a asset heavy demo that occurs \n\nhttps://github.com/user-attachments/assets/bfe5ce99-64c8-4b7a-aeea-c97858614a8c\n\n### Reproduction\n\nhttps://stackblitz.com/~/edit/tresjs-minimal-reproduction-sht9ttt5?file=src/App.vue\n\n### Steps to reproduce\n\n_No response_\n\n### System Info\n\n```shell\nSystem:\n OS: Linux 5.0 undefined\n CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz\n Memory: 0 Bytes / 0 Bytes\n Shell: 1.0 - /bin/jsh\n Binaries:\n Node: 18.20.3 - /usr/local/bin/node\n Yarn: 1.22.19 - /usr/local/bin/yarn\n npm: 10.2.3 - /usr/local/bin/npm\n pnpm: 8.15.6 - /usr/local/bin/pnpm\n npmPackages:\n @tresjs/cientos: 4.1.0 => 4.1.0 \n @tresjs/core: 4.3.2 => 4.3.2 \n @tresjs/leches: ^0.14.0 => 0.14.0 \n vite: ^6.0.3 => 6.0.5\n```\n\n### Used Package Manager\n\npnpm\n\n### Code of Conduct\n\n- [x] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/tres/blob/main/CODE_OF_CONDUCT.md)\n- [x] Read the [Contributing Guidelines](https://github.com/Tresjs/tres/blob/main/CONTRIBUTING.md).\n- [x] Read the [docs](https://tresjs.org/guide).\n- [x] Check that there isn't [already an issue](https://github.com/tresjs/tres/issues) that reports the same bug to avoid creating a duplicate.\n- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[3106],{"name":3107,"color":3108},"p4-important-bug","D93F0B",909,"on-demand invalidation not triggered when assets are loaded.","2025-02-06T09:34:37Z","https://github.com/Tresjs/tres/issues/909",0.70482075,{"description":3115,"labels":3116,"number":3117,"owner":3021,"repository":3072,"state":3098,"title":3118,"updated_at":3119,"url":3120,"score":3121},"### Describe the bug\n\nWhen running `pnpm run docs:dev` and visiting `http://localhost:5173/guide/` the terminal displays the following warning:\r\n\r\n```\r\n5:05:06 PM [vitepress] hmr update /guide/index.md\r\nAssets in public directory cannot be imported from JavaScript.\r\nIf you intend to import that asset, put the file in the src directory, and use /src/playground.png instead of /public/playground.png.\r\nIf you intend to use the URL of that asset, use /playground.png?url.\r\nFiles in the public directory are served at the root path.\r\nInstead of /public/playground.png, use /playground.png.\r\n```\n\n### Reproduction\n\nNone\n\n### Steps to reproduce\n\n* In the terminal, run `pnpm run docs:dev`\r\n* In the browser, visit `http://localhost:5173/guide/`\r\n* In the terminal, see the warning\n\n### System Info\n\n```shell\nSystem:\r\n OS: macOS 14.0\r\n CPU: (8) arm64 Apple M1\r\n Memory: 136.88 MB / 8.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 20.8.1 - /opt/homebrew/bin/node\r\n npm: 10.1.0 - /opt/homebrew/bin/npm\r\n pnpm: 8.6.5 - /opt/homebrew/bin/pnpm\r\n Browsers:\r\n Chrome: 120.0.6099.234\r\n Safari: 17.0\r\n npmPackages:\r\n @tresjs/cientos: 3.7.0 => 3.7.0 \r\n @tresjs/eslint-config-vue: ^0.2.1 => 0.2.1 \r\n vite: ^5.0.10 => 5.0.10\n```\n\n\n### Used Package Manager\n\npnpm\n\n### Code of Conduct\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/tres/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/tres/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/tres/issues) that reports the same bug to avoid creating a duplicate.\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[],518,"docs(bug): vitepress console warning, playground image","2024-01-22T08:31:09Z","https://github.com/Tresjs/tres/issues/518",0.7263637,{"description":3123,"labels":3124,"number":3134,"owner":3021,"repository":3072,"state":3098,"title":3135,"updated_at":3136,"url":3137,"score":3138},"### Description\n\nWhat is the right way to use some of the in-built funcions for the template instance?\r\n\r\nFor example, to add layers or other methods like getObjectId, add, etc?\r\n\r\nNow, if I try this:\r\n`\u003CTresMesh :position=\"[-2, 2, 0]\" :rotation=\"[0, Math.PI, 0]\" :getObjectId=\"simpleLog\">` Doesn't work, or even execute my function\r\n\r\nSame with layers\r\n`\u003CTresMesh :position=\"[-2, 2, 0]\" :rotation=\"[0, Math.PI, 0]\" :layers-enable=\"5\">`\n\n### Suggested solution\n\nAccept the inline methods\n\n### Alternative\n\n_No response_\n\n### Additional context\n\nI know I can do this by template ref, but for many cases will be useful and less code, if we could access that methods inline.\r\n\r\nWhat do you think?\n\n### Validations\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/tres/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/tres/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/tres/issues) that reports the same bug to avoid creating a duplicate.",[3125,3128,3131],{"name":3126,"color":3127},"question","d876e3",{"name":3129,"color":3130},"discussion 💭","AE4C80",{"name":3132,"color":3133},"investigation","D03599",542,"Use of functions in the template instances?","2024-02-08T12:33:56Z","https://github.com/Tresjs/tres/issues/542",0.7318509,["Reactive",3140],{},["Set"],["ShallowReactive",3143],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fqtl0iSbLXyAKpr80sva_6BKC6KZztYiUT5LqVWxa2rg":-1},"/Tresjs/cientos/434"]