Page MenuHomePhorge

T15774: Celerity: javascript minification issue with template literals (backticked strings)
ClosedPublic

Authored by mturdus on Apr 7 2024, 11:49.

Details

Test Plan

This archive contains a small demo:


When installed, an application named D25571 appears under "More Applications".
When you start it, you will see 2 messageboxes: one should be a single lined text, the other a multilined text.

Steps:

  1. unpack archive in some directory
  2. add ext-D25571/src/ path to load-libraries in local.json
  3. bin/arc liberate
  4. bin/cache purge --all
  5. bin/celerity map
  6. restart httpd
  7. start D25571 application from More Applications

Also:

arc unit ./src/applications/celerity/__tests__/CelerityResourceTransformerTestCase.php

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mturdus requested review of this revision.Apr 7 2024, 11:49
mturdus retitled this revision from Summary: T15774. to T15774: Celerity: javascript minification issue with template literals (backticked strings).Apr 7 2024, 11:51

Write Phorge application extension which uses backticked strings containing spaces.

"uses" in which way(s)? Is there a chance that you could provide some minimal, self-contained testcase?

Verify the javascript content from your extension.

How? Could you provide clearer steps that allow others to test this? Thanks a lot!

add unit test

It can be tested with:

arc unit ./src/applications/celerity/__tests__/CelerityResourceTransformerTestCase.php

The linter now screams nonsense things because of my little new unit test, taken from the proposed tar.gz file. Probably better than nothing. Tested A/B and it makes sense. Also the addition makes sense to me, compared to the other ones.

To God: please sorry us, for what we are doing here. We know, parsing JavaScript by regex is evil. But hey, it still works.

This revision is now accepted and ready to land.Jun 4 2024, 01:29

Please add some negative tests - things that could trigger this thing, but shouldn't.

For example

foo = "this isn't ` a `real` tick ";

"`there`; and back again";

There's maybe more possible things.

This revision was landed with ongoing or failed builds.Jun 11 2024, 15:09
This revision was automatically updated to reflect the committed changes.