Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix javascript enqueue handle #239

Merged
merged 4 commits into from
Jul 10, 2022
Merged

🐛 Fix javascript enqueue handle #239

merged 4 commits into from
Jul 10, 2022

Conversation

Log1x
Copy link
Member

@Log1x Log1x commented Jul 8, 2022

chore(bundle): Add missing docblocks
@Log1x Log1x requested a review from QWp6t July 8, 2022 14:36
@QWp6t QWp6t changed the title fix(bundle): Fix javascript enqueue handle (Fixes #238) 🐛 Fix javascript enqueue handle Jul 8, 2022
Copy link
Member

@QWp6t QWp6t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with using + instead of array_merge() when it comes to indexed arrays is that it will clobber matching indexes on the 2nd array. So we'll have to figure out a more workable solution, I think, unless entrypoints.json will NEVER have js and mjs keys at the same time. (cc @kellymears)

image

image

@kellymears
Copy link
Member

kellymears commented Jul 10, 2022

@QWp6t If a user enables esm it likely will not emit js -- with defaults.

But there may be very good reasons to use mjs and js together, I'm really not sure. I think it's good to support mjs/js both, if possible. It would be pretty easy for users to make a couple small mods and end up in a situation where both keys are present.

@Log1x Log1x requested a review from QWp6t July 10, 2022 06:55
@Log1x
Copy link
Member Author

Log1x commented Jul 10, 2022

Adding an array_merge() to inline() in Enqueueable seems to be the easiest solution. This will keep the array keys the same during enqueueing and inlining.

Screenshot

Copy link
Member

@QWp6t QWp6t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@QWp6t QWp6t merged commit 5b15b2f into 2.x Jul 10, 2022
@QWp6t QWp6t deleted the fix/inline-script-enqueue branch July 10, 2022 07:07
QWp6t pushed a commit that referenced this pull request Jul 15, 2022
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