{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":317178763,"defaultBranch":"main","name":"stimulus-bridge","ownerLogin":"symfony","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2020-11-30T09:51:49.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/143937?v=4","public":true,"private":false,"isOrgOwned":true},"refInfo":{"name":"","listCacheKey":"v0:1679340223.0","currentOid":""},"activityList":{"items":[{"before":"b49d87bb5496ee25ae122d34c23ee562d591b1aa","after":"d58dc502386573b93cc7442939b4053620ab7966","ref":"refs/heads/main","pushedAt":"2023-03-20T19:23:45.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"weaverryan","name":"Ryan Weaver","path":"/weaverryan","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121003?s=80&v=4"},"commit":{"message":"Tagging 3.2.2","shortMessageHtmlLink":"Tagging 3.2.2"}},{"before":"7ce6105e492c14de7f38b2512377bcc27d315ede","after":"b49d87bb5496ee25ae122d34c23ee562d591b1aa","ref":"refs/heads/main","pushedAt":"2023-03-20T19:22:37.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"weaverryan","name":"Ryan Weaver","path":"/weaverryan","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121003?s=80&v=4"},"commit":{"message":"bug #81 [Bug] Removing unnecessary Promise in object of controllers to be loaded (weaverryan)\n\nThis PR was squashed before being merged into the main branch.\n\nDiscussion\n----------\n\n[Bug] Removing unnecessary Promise in object of controllers to be loaded\n\nHi!\n\nSubtle change. Previously, the webpack loader parsed `controllers.json` (which eventually becomes the `symfonyControllers` variable in `index.ts`) into something that exported an object where each key was a promise - something like:\n\n```js\nexport default {\n 'symfony--ux-autocomplete--autocomplete': import(/* webpackMode: \\\"eager\\\" */ '`@symfony`/ux-autocomplete/dist/controller.js')\n}\n```\n\nThen, in `startStimulusApp()`, we called used `.then()` to wait for that promise to resolve then registered its resolved value:\n\n```js\nsymfonyControllers[controllerName].then((module) => {\n application.register(controllerName, module.default);\n});\n```\n\nThis is totally unnecessary and a relic of how this library was originally built. It also causes the UX controllers to be registered *late*. It's barely noticeable, but in practice, instead of the UX controllers being registered BEFORE the DOM is ready, they are registered after. This actually causes a problem with a new feature from LiveComponents.\n\nThe new parsed version of `controllers.json` from the loader looks much simpler:\n\n```diff\n+ import controller_0 from '`@symfony`/ux-autocomplete/dist/controller.js';\n\nexport default {\n- 'symfony--ux-autocomplete--autocomplete': import(/* webpackMode: \\\"eager\\\" */ '`@symfony`/ux-autocomplete/dist/controller.js')\n+ 'symfony--ux-autocomplete--autocomplete': controller_0,\n}\n```\n\n(I don't show it here, but lazy controllers have a similar simplification).\n\nIn short: it's a bug fix & an easy win. Controllers will load slightly earlier as a result.\n\nThanks!\n\nCommits\n-------\n\n0d77e41 [Bug] Removing unnecessary Promise in object of controllers to be loaded","shortMessageHtmlLink":"bug #81 [Bug] Removing unnecessary Promise in object of controllers t…"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"startCursor":"Y3Vyc29yOnYyOpK7MjAyMy0wMy0yMFQxOToyMzo0NS4wMDAwMDBazwAAAAMHdPn4","endCursor":"Y3Vyc29yOnYyOpK7MjAyMy0wMy0yMFQxOToyMjozNy4wMDAwMDBazwAAAAMHdM6t"}},"title":"Activity · symfony/stimulus-bridge"}