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

Breaking/tdr 9/handlebars 4 upgrade #1373

Draft
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

oatymart
Copy link
Contributor

@oatymart oatymart commented Jan 3, 2020

https://oat-sa.atlassian.net/browse/TR-3264
https://oat-sa.atlassian.net/wiki/spaces/FOUN/pages/144081031/Upgrade+Handlebars

This extension is a bit more complex because it contains the portableLib folder for PCIs, and the portablelement grunt task definition.

  • bump dependencies in package.json
  • rebundle JS
  • composer dependency update

@codeclimate
Copy link

codeclimate bot commented Jan 3, 2020

Code Climate has analyzed commit dfdb4b8 and detected 0 issues on this pull request.

View more on Code Climate.

@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01% ⚠️

Comparison is base (45d7110) 16.06% compared to head (a1ac13b) 16.06%.
Report is 126 commits behind head on develop.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #1373      +/-   ##
=============================================
- Coverage      16.06%   16.06%   -0.01%     
- Complexity      4207     4208       +1     
=============================================
  Files            391      391              
  Lines          13491    13492       +1     
=============================================
  Hits            2168     2168              
- Misses         11323    11324       +1     

see 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link

Version

🚨 Your pull request contains a BREAKING CHANGE, please be sure to communicate it.
❕ Some commits are not using the conventional commits formats. They will be ignored in version management.

Target Version 31.0.0
Last version 30.2.7

There are 2 BREAKING CHANGES, 2 features, 0 fix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is a copy of one of the handlebars 4.7.8 modules installed in node_modules. I was in 2 minds, but I placed it here in portableLib (beside handlebars 1.3.0) to match the way some current PCIs (not all) are resolving these "portable" modules. If this is ok, I could remove handlebars.js (unless you think we should hold onto it for backwards compatibility).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty sure this file is never even called by any of the PCIs I've tested.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, I did not find any usage. However, some 3rd-party PCI providers could use it.

@jsconan jsconan self-requested a review September 29, 2023 13:54
Copy link
Contributor

@jsconan jsconan left a comment

Choose a reason for hiding this comment

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

The idea of using a different namespace for Handlebars in PCI is good. However, it will only work if we can make sure the lib is loaded before. This is the tricky part: we rely on the same mechanism to load the helpers both for the PCI compiler and the regular TAO compiler. The regular compiler will preload the system default Handlebars, we need it for TAO related bundles. When discovering a PCI we need to replace it by the portableLib, but at this stage it is already too late as the RequireJS dependencies tree is already built... If you have some idea, you are welcome :)

Look at https://oat-sa.atlassian.net/browse/ADF-1293 for having a use case.

@@ -34,7 +34,7 @@ define([], function () {
return function moduleWriter(moduleName, compiled) {
let handlebars = 'handlebars';
if (isPciRuntime(moduleName)) {
handlebars = 'taoQtiItem/portableLib/handlebars';
handlebars = 'taoQtiItem/portableLib/handlebars_4';
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: The idea looks very good. However, we need to make sure that taoQtiItem/portableLib/handlebars_4 is loaded in the first place. Without this, the runtime will declare a dependency on an inexistent package...

See oat-sa/extension-tao-itemqti-pci#379 (comment)

@swiec
Copy link

swiec commented Oct 3, 2023

@mike-ionut-mihai-sandu-tao just to remind you, that you still didn't pay my invoice.

@oatymart oatymart marked this pull request as draft June 7, 2024 08:11
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.

4 participants