generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Detect inline XML fragments & views (#519)
JIRA: CPOUI5FOUNDATION-986 --------- Co-authored-by: Matthias Osswald <[email protected]>
- Loading branch information
Showing
13 changed files
with
667 additions
and
10 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
sap.ui.require(["sap/ui/core/Fragment"], async (Fragment) => { | ||
const content = await Fragment.load({ | ||
type: "XML", | ||
"definition": `<core:FragmentDefinition | ||
xmlns="sap.m" | ||
xmlns:core="sap.ui.core"> | ||
<Button tap=".sayHello"> | ||
</core:FragmentDefinition>`, | ||
}); | ||
|
||
const content2 = await Fragment["load"]({ | ||
type: "XML", | ||
definition: `<core:FragmentDefinition | ||
xmlns="sap.m" | ||
xmlns:core="sap.ui.core"> | ||
<Button tap=".sayHello"> | ||
</core:FragmentDefinition>`, | ||
}); | ||
|
||
const content3 = await Fragment.load({ | ||
type: "HTML", // Should be ignored as analysis is only for XML fragments | ||
// Intentionally put XML content, so it must be skipped for compilation & analysis | ||
definition: `<core:FragmentDefinition | ||
xmlns="sap.m" | ||
xmlns:core="sap.ui.core"> | ||
<Button tap=".sayHello"> | ||
</core:FragmentDefinition>` | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
sap.ui.require([], () => { | ||
const fragment = sap.ui.fragment({ | ||
type: "XML", | ||
fragmentContent: `<core:FragmentDefinition | ||
xmlns="sap.m" | ||
xmlns:core="sap.ui.core"> | ||
<Button tap=".sayHello"> | ||
</core:FragmentDefinition>`, | ||
}); | ||
|
||
const fragment2 = sap.ui.xmlfragment({ | ||
"fragmentContent": `<core:FragmentDefinition | ||
xmlns="sap.m" | ||
xmlns:core="sap.ui.core"> | ||
<Button tap=".sayHello"> | ||
</core:FragmentDefinition>`, | ||
}); | ||
|
||
const fragment3 = sap["ui"].xmlfragment({ | ||
"fragmentContent": `<core:FragmentDefinition | ||
xmlns="sap.m" | ||
xmlns:core="sap.ui.core"> | ||
<Button tap=".sayHello"> | ||
</core:FragmentDefinition>`, | ||
}); | ||
|
||
const fragment4 = sap.ui.fragment({ | ||
type: "HTML", // Should be ignored as analysis is only for XML fragments | ||
// Intentionally put XML content, so it must be skipped for compilation & analysis | ||
fragmentContent: `<core:FragmentDefinition | ||
xmlns="sap.m" | ||
xmlns:core="sap.ui.core"> | ||
<Button tap=".sayHello"> | ||
</core:FragmentDefinition>`, | ||
}); | ||
}); |
Oops, something went wrong.