Page MenuHomePhabricator

Investigate test case for "${in}${terpolotation}" and "iterated-interpolation" (import-interpolation.less test case)
Closed, ResolvedPublic

Description

1) phpunit_FixturesTest::testFixture with data set "Fixtures/lessjs-2.5.3 import-interpolation" (…)
Standard compiler
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'body {
-  width: 100%;
-}
-#logo {
-  width: 100px;
-  height: 100px;
-  background: url('../assets/logo.png');
-  background: url("#inline-svg");
-}
-
-.a {
-  var: test;
-}'

+'variable @in is undefined in import-interpolation.less on line 5, column 9
+3| @import "import/import-@{my_theme}-e.less";
+4| 
+5| @import "import/import-@{in}@{terpolation}.less";
+6| 
+7| @import "import/interpolation-vars.less";
+8|'

Event Timeline

Krinkle triaged this task as Medium priority.Jan 5 2024, 2:23 PM
Hokwelum renamed this task from Investigate test case for "${in}${terpolotation}" and "iterated-interpolation" (strings.less test case) to Investigate test case for "${in}${terpolotation}" and "iterated-interpolation" (import-interpolation.less test case) .Jan 29 2024, 11:47 PM

Change 1005100 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/libs/less.php@master] docs: Write "Overview" and "Compatibility" in CONTRIBUTING.md

https://gerrit.wikimedia.org/r/1005100

Change 1005131 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/libs/less.php@master] Parser,Environment: Reduce various internal use of static state

https://gerrit.wikimedia.org/r/1005131

Krinkle subscribed.

I thought this would be a quick one, but my local patch is getting quite large already. Hannah expressed interest in doing this one so I'll hand it over to you!

  • [1.4.0] import interpolation finished.
    • refactored the import phase to occur only within the import visitor, so that the import eval env can be passed between imports.
    • Implement finish callback in ImportVisitor
    • Change Parser.parse to apply ImportVisitor later, and pass the finish callback.

      https://github.com/less/less.js/commit/5d54af2039
  • [2.0.0] fix import sequencing
    • Implement Import.prototype.isVariableImport and Quoted.prototype.containsVariables.
    • Change Ruleset.prototype.variables to handle imported variables.
    • Implement ImportSequencer.
    • Change ImportVisitor to use the new ImportSequencer.

      https://github.com/less/less.js/pull/2246/files

I've pushed a few smaller patches just now that improve the documentation and get a few things into place before these big changes.

Change 1005100 merged by jenkins-bot:

[mediawiki/libs/less.php@master] docs: Write "Overview" and "Compatibility" in CONTRIBUTING.md

https://gerrit.wikimedia.org/r/1005100

Change 1005131 merged by jenkins-bot:

[mediawiki/libs/less.php@master] Parser,Environment: Reduce various internal use of static state

https://gerrit.wikimedia.org/r/1005131

Change 1007622 had a related patch set uploaded (by Hokwelum; author: Hokwelum):

[mediawiki/libs/less.php@master] Import Visitor

https://gerrit.wikimedia.org/r/1007622

Change 1007622 merged by jenkins-bot:

[mediawiki/libs/less.php@master] Implement ImportVisitor to support interpolated variable imports

https://gerrit.wikimedia.org/r/1007622