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

[FIX] moduleBundler: Apply defaultFileTypes #580

Merged
merged 3 commits into from
Mar 4, 2021
Merged

Conversation

matz3
Copy link
Member

@matz3 matz3 commented Feb 3, 2021

Use default if not provided in bundle definition.

In the past neither a default, nor the bundle definition configuration
was used, since the parameter was mistakenly expected on the bundle
options.

Also align the defaults for library- and component-bundles with Maven.

New moduleBundler defaults:

  • .js
  • .control.xml
  • .fragment.html
  • .fragment.json
  • .fragment.xml
  • .view.html
  • .view.json
  • .view.xm

Component-bundles (Component-preload.js and sap-ui-custom.js) additionally include:

  • .properties
  • and via filters:
    • ${namespace}/**/manifest.json
    • ${namespace}/changes/flexibility-bundle.json
    • ${namespace}/changes/changes-bundle.json

@coveralls
Copy link

coveralls commented Feb 8, 2021

Coverage Status

Coverage increased (+0.004%) to 93.966% when pulling fe32c5f on defaultFileTypes into 11f823a on master.

Use default if not provided in bundle definition.

In the past neither a default, nor the bundle definition configuration
was used, since the parameter was mistakenly expected on the bundle
options.

Also align the defaults for library- and component-bundles with Maven.
@RandomByte RandomByte marked this pull request as ready for review February 26, 2021 14:39
@RandomByte RandomByte changed the title WIP: Fix defaultFileTypes [FIX] moduleBundler: Apply defaultFileTypes Feb 26, 2021
RandomByte added a commit to SAP/ui5-tooling that referenced this pull request Feb 26, 2021
@RandomByte
Copy link
Member

RandomByte commented Mar 3, 2021

Paging @codeworrior:

Should changes/flexibility-bundle.json be part of a Component-preload.js? It is right now, but won't be after this change since we remove .json from the default file types.

EDIT: Based on this comment I understand that flex changes must be part of the Component-preload.js:

we know they are in the preload if they exist. Therefore, we do not send any request if they are NOT preloaded.

@@ -85,12 +85,25 @@ module.exports = function({
allNamespaces.forEach((ns) => {
if (ns !== namespace && ns.startsWith(`${namespace}/`)) {
filters.push(`!${ns}/`);
// Explicitly exclude manifest.json files of subcomponents since the general exclude above this
// comment only applies to the configured default file types, which do not include ".json"
filters.push(`!${ns}/**/manifest.json`);
Copy link
Member

@RandomByte RandomByte Mar 3, 2021

Choose a reason for hiding this comment

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

Not sure whether this is our intention. But I guess it's a good solution for the time being.

The exclude-regex generated by ResourceFilterList always applies the default file types and therefore won't exclude manifest.json:

// !library/h/components/subcomponent3/ --> exclude: 
/^library\/h\/components\/subcomponent3\/(?:[^/]+\/)*[^/]*(?:\.js|\.control\.xml|\.fragment\.html|\.fragment\.json|\.fragment\.xml|\.view\.html|\.view\.json|\.view\.xml|\.properties)$/

Copy link
Member Author

@matz3 matz3 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@RandomByte RandomByte left a comment

Choose a reason for hiding this comment

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

LGTM

@matz3 matz3 merged commit 42f6474 into master Mar 4, 2021
@matz3 matz3 deleted the defaultFileTypes branch March 4, 2021 16:34
RandomByte added a commit to SAP/ui5-tooling that referenced this pull request Apr 19, 2021
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.

None yet

3 participants