Skip to content

Commit

Permalink
Merge branch '6.4' into 7.1
Browse files Browse the repository at this point in the history
* 6.4:
  [AssetMapper] Fix `JavaScriptImportPathCompiler` regex for non-latin characters
  Definition::$class may not be class-string
  require Cache component versions compatible with Redis 6.1
  [Twitter][Notifier] Fix post INIT upload
  [Messenger][RateLimiter] fix additional message handled when using a rate limiter
  [Serializer] fixed object normalizer for a class with `cancel` method
  Fix bucket size reduce when previously created with bigger size
  • Loading branch information
xabbuh committed Nov 9, 2024
2 parents f918f7e + 21fe29b commit bd09ac2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Compiler/JavaScriptImportPathCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ final class JavaScriptImportPathCompiler implements AssetCompilerInterface
)
\s*[\'"`](\.\/[^\'"`\n]++|(\.\.\/)*+[^\'"`\n]++)[\'"`]\s*[;\)]
?
/mx';
/mxu';

public function __construct(
private readonly ImportMapConfigReader $importMapConfigReader,
Expand Down
16 changes: 16 additions & 0 deletions Tests/Compiler/JavaScriptImportPathCompilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,22 @@ public static function provideCompileTests(): iterable
'expectedJavaScriptImports' => ['/assets/other.js' => ['lazy' => false, 'asset' => 'other.js', 'add' => true]],
];

yield 'static_named_import_with_unicode_character' => [
'input' => 'import { ɵmyFunction } from "./other.js";',
'expectedJavaScriptImports' => ['/assets/other.js' => ['lazy' => false, 'asset' => 'other.js', 'add' => true]],
];

yield 'static_multiple_named_imports' => [
'input' => <<<EOF
import {
myFunction,
helperFunction
} from "./other.js";
EOF
,
'expectedJavaScriptImports' => ['/assets/other.js' => ['lazy' => false, 'asset' => 'other.js', 'add' => true]],
];

yield 'static_import_everything' => [
'input' => 'import * as myModule from "./other.js";',
'expectedJavaScriptImports' => ['/assets/other.js' => ['lazy' => false, 'asset' => 'other.js', 'add' => true]],
Expand Down

0 comments on commit bd09ac2

Please sign in to comment.