-
Notifications
You must be signed in to change notification settings - Fork 7
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
Issue #2329 - Upgrade and cleanup of Polymer sources #2361
Open
jhou-pro
wants to merge
183
commits into
develop
Choose a base branch
from
Issue-#2329-experiment
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+332,645
−253,279
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…onents updater script. These contain stuff for web testing.
This code was not really insecure as it was used strictly for generating UUIDs at the client site, not related to security. Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This reverts commit ff76d6d.
…ing set)." This reverts commit e27f9f4.
…ing set)." This reverts commit 450f950.
This reverts commit 39bec76.
…mer+components updater script. These contain stuff for web testing." This reverts commit f128494.
@polymer/test-fixture chai mocha wct-browser-legacy wct-mocha @polymer/iron-test-helpers (github) + from polymer.json extras: @polymer/sinonjs
└── @webcomponents ├── shadycss └── webcomponentsjs └── @Polymer ├── iron-test-helpers ├── polymer ├── sinonjs (no update) └── test-fixture (no update)
1. Added explicit dependency for shadycss of no less than latest version. 2. Increased version of dependencies to no less than latest. 3. Shuffled for better structure.
The only actual changes were in Chai and Mocha. No conflict with web testing capabilities.
Four commits squashed to two changes. Originally was needed for performance. However, EGI is partially invisible without these changes. Perhaps, later evolution of EGI was impacted by presence of these changes. Original: a. #1329 Added various performance tweaks to our code, ShadyCSS's apply-shim and iron-resizable/fit-behaviors (75e988a). iron-fit-behavior.js iron-resizable-behavior.js apply-shim.js b. #1331 #1331 Next steps implementing long-living service worker that gradually manages cache of resources (0da4eca). iron-resizable-behavior.js apply-shim.js e. #1329 Remved redundant code (e3f1f54). iron-fit-behavior.js -- reverted one of "performance tweaks" apply-shim.js -- reverted one of "performance tweaks" f. #1329 Provided comments to apply-shim file to indicate bottlenecks (a269663). apply-shim.js
This reverts commit 4fe98c5.
9. After major upgrade for Chai from last supported by WCT 4.5.0 version to version 5.1.1 web tests are failing with errors that 'chai' global variable is not defined. We needed to load it explicitly through ES6 module loading (and also dependent sinon-chai).
9. After major upgrade for Mocha from last supported by WCT version to version 10.7.3 web tests are failing with errors that 'Mocha.utils.highlightTags' method is not defined. Highlighting of code didn't work previously. And it is of little value now. An attempt was made to incorporate it. See below (taken from highlight-tags.js in Mocha). However, CSS styles were not present and thus it wasn't usable. if (window.top.document.getElementById('mocha')) { if (!Mocha.utils.highlightTags) { /** * Highlight the given string of `js`. * * @Private * @param {string} js * @return {string} */ function highlight(js) { return js .replace(/</g, '<') .replace(/>/g, '>') .replace(/\/\/(.*)/gm, '<span class="comment">//$1</span>') .replace(/('.*?')/gm, '<span class="string">$1</span>') .replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>') .replace(/(\d+)/gm, '<span class="number">$1</span>') .replace( /\bnew[ \t]+(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>' ) .replace( /\b(function|new|throw|return|var|if|else)\b/gm, '<span class="keyword">$1</span>' ); } /** * Highlight the contents of tag `name`. * * @api private * @param {string} name */ Mocha.utils.highlightTags = function(name) { var code = window.top.document.getElementById('mocha').getElementsByTagName(name); for (var i = 0, len = code.length; i < len; ++i) { code[i].innerHTML = highlight(code[i].innerHTML); } }; } Mocha.utils.highlightTags('code'); }
9. After major upgrade for Mocha from last supported by WCT version to version 10.7.3 only one web test can be run. Others in suite and in other suites are not started due to hidden error inside WCT saying that 'runner.stats' are not initialised. We take wct-mocha.js way of initialising this object.
They were either actually required for our components (like neon-animation) or just a transitive (but nice to have to see actual dependencies and versions).
Only google-chart had major upgrade from 3.0.4 to 5.1.0. This commit brings package.json to actual versions we use. I.e. can be a reference to determine actual versions.
Which didn't cause problems due to transitive loading.
…test 2.30.1 (2023). Update 'moment-timezone' dependency from 0.5.33 (2021, 2021a iana) to the latest 0.5.46 (2024). With ability to auto update using install-polymer.sh later.
…test 2.30.1 (2023). Update 'moment-timezone' dependency from 0.5.33 (2021, 2021a iana) to the latest 0.5.46 (2024). With ability to auto update using install-polymer.sh later. (regenerated the tree)
03 minutes can not be matched by 'm' and requires 'mm'.
E.g. 09 months can not be matched by 'M' and requires 'MM'.
To make Code Scan alerts updated. And test vulcanised version.
Enhanced Rollup processing and tree shaking process to rewrite CommonJS (node modules based) libraries to ES module form. * Excluded some files we want to leave 'as is' (at least for now). * Added some comments. * Removed 'nodeResolve.extensions' override to ensure wider abilities to process libraries (just use reasonable @rollup/plugin-node-resolve defaults).
Regenerated the tree. Notice duplicate 'moment.js' that generates along with 'moment-with-locales.js'.
As soon as out 'moment' and 'moment-timezone' became ES6 compliant it is necessary to properly import them as per https://momentjs.com/timezone/docs/ See the excerpt below: // Unnecessary, can cause issues with package managers import moment from 'moment'; import 'moment-timezone'; // Correct import moment from 'moment-timezone';
Regenerated the tree.
Regenerated the tree.
Making it more future-proofing and less dependent on lib maintainer decisions on how to build libraries.
Regenerated the tree.
Not checked on Windows, though. So, probably will require further changes.
Previously interfered with vulcanisation. Now interferes with maven 'clean install' build.
Regenerated the tree.
jhou-pro
changed the title
Issue #2329
Issue #2329 - Upgrade and cleanup of Polymer sources
Dec 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolve #2329
To be completed by the pull request creator
This section should be completed with reference to section Preparing PR of the Code and PR reviews wiki page.
Converted PR to draft while it is being prepared by tapping the "Convert to draft" link beneath the "Reviewers" section.
A self-review of all changes has been completed, and the changes are in sync with the issue requirements.
Changes to the requirements have been reflected in the issue description.
Developer documentation (e.g., comments, Javadoc), have been provided where required.
All tests (all existing tests) pass successfully.
The correct base branch has been selected for these changes to be merged into.
The latest changes from the base branch have already been merged into this feature branch (and tested).
Added
Wiki like
to the issue.Changes subject to performance considerations have been evaluated, and tested against production-size data if applicable.
This pull request does contain significant changes, the section "Significant changes" below is completed and at least one Senior Software Engineer with the relevant area of expertise has been selected as reviewer.
The
In progress
label has been removed from the issue.The
Pull request
label has been added to the issue.Made PR ready for review by tapping the "Ready for review" button below the list of commits on the PR page.
Additional details
Due to very large changes (most of them from
wct-browser-legacy
dependencies override) it is not practical to review them in github. Opening of changes there will likely freeze the whole page. Please look at the overview below by individual folders and useIntelliJ
withGit plugin
or other diff client (likekdiff3
) folder by folder:in
/web/
folder (where our components reside):antlr-lib.js
instead of direct*.mjs
file importmoment-lib.js
rationalised and updated libsmoment
version of lib (covered by web tests)http://
tohttps://
links to avoid vulnerabilitiesjquery
, used exclusively ford3
examplecrypto.randomUUID()
intg-polymer-utils
to avoid vulnerabilityin
/resources/*.*
build-polymer.js
package-lock.json
for Dependabot vulnerability checkingpolymer
building torollup
buildingpolymer
subfolder) updated + tree shaken (+additionallymoment/moment-timezone/antlr4
)package.json
files not to show "incorrect" vulnerabilitiespackage.json
with exact versions that we use (+used^
to facilitate easy update between patch and minor versions) -- please immediately change this file to the latest versions after updatedevDependencies
section ofpackage.json
wct-browser-legacy
dependencies to the latest versions to avoid vulnerabilities and code scanning alerts as much as possiblewct-browser-legacy
dependencies versions to control them tightly (no^
sign)in
/resources/gis/
leaflet/esri
(not yet onnpm
infrastructure)in
/resources/lib/
npm
-based library import files to generate rewritten/resources/polymer/lib/*-lib.js
files for importing in our components; and to facilitate library tree shakingin
/resources/_virtual/
CommonJS
lib code (madeES6
compliant) (seemoment/moment-timezone
)Significant changes
This pull request contains significant changes as defined in the wiki page.
Details are as follows:
Dependencies were changed in this PR. Overview of actually changed dependencies is below. Please refer to individual commit messages for more information (many of them have explanations and additional information).
To be completed by the pull request reviewer
This section should be completed with reference to section Performing PR review of the Code and PR reviews wiki page.
The
In progress
label has been added to the pull request in GitHub.The issue requirements have been read and understood (along with any relevant emails and/or Slack messages).
The correct base branch is specified, and that base branch is up-to-date in the local source.
The issue branch has been checked out locally, and had the base branch merged into it.
All automated tests pass successfully.
Ensure the implementation satisfies the functional requirements.
Ensure that code changes are secure and align with the established coding practices, including code formatting and naming conventions.
Ensure that code changes are documented and covered with automated tests as applicable.
Ensure that code changes are well-suited for informal reasoning.
Ensure that changes are documented for the end-user (a software engineer in the case of TG, or an application user in the case of TG-based applications).
If there are significant changes (described above), special attention has been paid to them.
Marked the task items in section "Significant changes" as completed to indicated that corresponding changes have been reviewed, improved if necessary, and approved.
The issue or issues addressed by the pull request are associated with the relevant release milestone.
To be completed by the pull request reviewer once the changes have been reviewed and accepted
The changes have been merged into the base branch (unless there is a specific request not to do so, e.g., they are to be released to SIT).
The issue branch has been deleted (unless the changes have not been merged - see above, or there is a specific request not to do so).
The
In progress
label has been removed from the pull request.The
Pull request
label has been removed from the pull request.