Skip to content

Comments

Update js asset registration#87

Merged
luisdalmolin merged 3 commits intokirschbaum-development:mainfrom
jayson-temporas:issue_global_variables_conflict
Feb 23, 2026
Merged

Update js asset registration#87
luisdalmolin merged 3 commits intokirschbaum-development:mainfrom
jayson-temporas:issue_global_variables_conflict

Conversation

@jayson-temporas
Copy link
Contributor

Fix for Issue #86

@nathanheffley
Copy link
Member

This seems like an unusual way to fix this issue, I'm not sure I've really ever seen a package use the iife format as modern packages are usually isolated by default anyway. Is it possible to figure out what is conflicting and fix the way we are registering it in the code instead?

@jayson-temporas jayson-temporas changed the title update build format to iife Update js asset registration Feb 21, 2026
@jayson-temporas
Copy link
Contributor Author

Current asset registration use this:
Js::make('commentions-scripts', DIR . '/../resources/dist/commentions.js')

Which will produce <script src=".."> and this is not isolated. all variables and functions are in global namespace.

Fix is to either use iife or update the asset registration to use module
Js::make('commentions-scripts', DIR . '/../resources/dist/commentions.js')->module()

This will produce <script src=".." type="module"> which is isolated.

Remove the iife format now.

Thank you!

@luisdalmolin luisdalmolin merged commit 2d17e9b into kirschbaum-development:main Feb 23, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants