The code for locale_js_alter() contains the following comment.
// @todo Remove this in https://www.drupal.org/node/2421323.
$files = [];
foreach ($javascript as $item) {
if (isset($item['type']) && $item['type'] == 'file') {
// Ignore the JS translation placeholder file.
if ($item['data'] === 'core/modules/locale/locale.translation.js') {
continue;
}
$files[] = $item['data'];
}
}
Given that #2421323: Parse js files from library definitions during rebuild to minimize variable_set() calls has been closed time ago, I guess that either:
- The comment needs to be removed
- The code needs to be removed
I quickly read the other issue, but I cannot say which is the correct action.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 3092672-14.patch | 568 bytes | _utsavsharma |
| #14 | interdiff_8-14.txt | 568 bytes | _utsavsharma |
| #8 | drupal_remove_TODO_comment_3092672_8.patch | 539 bytes | avpaderno |
Comments
Comment #2
avpadernoI apologize: The other issue's status is Needs work, but it's marked for Drupal 7. I don't see any commit done for Drupal 8, although the issue was once marked for Drupal 8, so I am not really sure what this means.
Comment #7
larowlanUpdating category in basis of last comment
Comment #8
avpadernoSince #2421323: Parse js files from library definitions during rebuild to minimize variable_set() calls has been created in 2015 and it has never had a Drupal 8 patch, I take the intention wasn't to change Drupal 8 code and that comment is a left-over from Drupal 7.
Comment #11
smustgrave commentedThis issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.
Think I agree with #8, this comment appears to be carried from D7 for an issue that wasn't intended for D8
Comment #12
xjmComment #13
xjmThanks @smustgrave for digging this issue out. I reviewed #2421323: Parse js files from library definitions during rebuild to minimize variable_set() calls and in #6 of that issue @catch specifically descoped it from 8.x+.
For posterity, the new direction is #2607376: Remove on-demand JavaScript translation parsing and do everything on rebuild.
Unfortunately, this does not apply to 10.1.x, so we legitimately need a reroll. (#8 can still be used for the 9.5.x backport, as documentation fixes are eligible for backport.)
Saving credits. Thanks!
Comment #14
_utsavsharma commentedRerolled patch for 10.1.x.
Comment #15
xjmComment #16
xjmComment #17
smustgrave commentedChange is simple enough.
Thanks @xjm for the additional details.
Comment #20
xjmThanks @_utsavsharma and @smustgrave.
I committed #14 to 10.1.x, and #8 to 10.0.x and 9.5.x. Thanks!