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

[PoC] ResourcePool: Add option to prefer analyzing a resource's source content #553

Draft
wants to merge 6 commits into
base: v2
Choose a base branch
from

Conversation

RandomByte
Copy link
Member

@RandomByte RandomByte commented Nov 26, 2020

Follow up of #551 to improve dependency analysis.

JSModuleAnalyzer has trouble detecting some dependencies in minified code if they have been "mangled". E.g. in case jQuery is not named jQuery anymore.

This change solves that by trying to retrieve the debug ("source") content of a resource to analyze that instead of the minified version.

However, integrating this on the ResourcePool level is not ideal and a more general solution to this problem should be preferred.

Therefore this PR should only act as an illustration of the discussions and thoughts. Currently it should not be merged.

…stic

Stop analyzing debug-resources if they correspond to a non-debug
resource.

Only analyze the non-debug resource and copy any dependency information
to the corresponding debug-resource.

While this might not be the best approach given that analyzing the
source ("debug") version of a resource might result in finding more
dependencies (i.e. those mangled during minification), this change
ensures that we generate the same resources.json, independently
from the order of debug and non-debug resources supplied to the
resourceListCreator processor.

Resolves SAP/ui5-tooling#274
@RandomByte RandomByte changed the base branch from master to resources-json-generation-consistency November 26, 2020 16:15
@RandomByte RandomByte changed the title [FIX] generateResourcesJson: Make resources.json generation deterministic [PoC] ResourcePool: Add option to prefer analyzing a resource's source content Nov 26, 2020
…e content

Possible follow up of #551 to
improve dependency analysis.

JSModuleAnalyzer has trouble detecting some dependencies in minified
code if they have been "mangled". E.g. in case jQuery is not named
jQuery anymore.

This change solves that by trying to retrieve the debug ("source")
content of a resource to analyze that instead of the minified version.
However, integrating this on the ResourcePool level is not ideal and a
more general solution to this problem should be preferred.

Therefore this PR should only act as an illustration of the discussions
and thoughts. Currently it should not be merged.
@RandomByte RandomByte force-pushed the resources-pool-allow-analysis-of-resources-source branch from e3c1247 to 136c879 Compare November 26, 2020 16:23
Base automatically changed from resources-json-generation-consistency to master November 30, 2020 14:23
@RandomByte RandomByte changed the base branch from master to v2 November 3, 2022 13:36
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.

resourceListCreator: Different order of input resources leads to different results
1 participant