Playing with UI5 Tooling, I see that the ui5.yaml config file contains a framework library section, where we supposed to specify UI5 app dependencies, e.g. sap.m, sap.ui.core etc.:
specVersion: "2.5"
type: application
metadata:
name: com.myApp
framework:
name: OpenUI5
version: 1.95.0
libraries:
- name: sap.m
- name: sap.ui.core
If I understand it correctly, these libraries section is used to incorporate these libs into Component-preload.js. Is it a correct assumption?
My questions:
Should the framework/libraries section of ui5.yaml be identical to the sap.ui5/dependencies/libs one of manifest.json?
Should I specify this libraries section at all in case, if I consume UI5 lib from the CDN?
Related
I work in a project (Upgrade from AdobeExperienceManager 6.1 to 6.3 to 6.5) where after the Jackrabbit filevault-package-maven-plugin upgrade to version 1.3.2 the following error occurs:
Package of type 'MIXED' is legacy. Use one of the other types instead! # META-INF/vault/properties.xml, validator: jackrabbit-packagetype
I searched the code, there is no single occurrence of the word "MIXED". The field properties.xml exists but does not contain any of the information mentioned in the error.
My search is stuck on this properties.xml. The information that it is legacy didn't help much since there is no documented migration path I could find on experienceleague or adobe help.
Any suggestions what to change or what exactly does this error means?
As of the [jackrabbit.apache.org][1] -documentation the error refers to the package type.
Mixed packages are a model of the past (AEM 6.3).
Means to fix it we have to separate Application /apps /libs means all the OSGi stuff and all the rest as Content.
project
- app
- src/main/content/jcr_root
- apps
- content
- etc
- libs
- META-INF
has to be split in Application-(code) my-project-package-bundle:
project
- app
- src/main/**java/com/project**/packageName
- src/main/**test/com/project**/packageName
and Content (config, templating, other data that is no java/kotlin) my-project-package-content:
project
- app
- src/main/**resources**/jcr_root
- content
- component-dialogs
- pages-config
- etc
- META-INF
I'm making a library for persistence implementation. For that I want to use reflection to be able to restore an object from the storage.
I can't use dart:mirrors because this library will be use also in Flutter application. So I'm trying to use reflectable package. And here I'm getting a major issue with understanding of how it should work. The doc tells reflectable uses build package and that some files must be generated. But I couldn't find anywhere whether this generation should happen for each file in my library package or just those where reflectable is used.
My library project structure is standard:
/examples
/lib
/lib/src
/lib/my_package.dart
/test
/pubspec.yaml
When I run dart run build_runner or dart run build_runner lib from the project root I see for each file in /example and /tests a matching file is generated. But in /lib folder nothing is generated. Only file where I'm intending to use reflectable is /lib/src/persistence/persistence_model.dart. I've created a file /lib/build.yaml of following content:
targets:
$default:
builders:
reflectable:
generate_for:
- src/persistence/persistence_model.dart
options:
formatted: true
but it seems to have no effect.
So, what should be right approach?
And probably a side question or rather consideration: isn't using reflection in Dart and Flutter excessively complex comparing to other languages (Python, C#, Java)?
I'm playing with the UI5 minifying and uglifying. As far as I know, there are two common approaches:
Grunt task with gruntfile.cjs, based on grunt-openui5.
UI5 Tooling with ui5.yaml, based on #ui5/cli.
My ui5.yaml:
specVersion: "2.5"
type: application
metadata:
name: com.myapp
framework:
name: OpenUI5
version: 1.95.0
resources:
configuration:
paths:
webapp: src/webapp
builder:
cachebuster:
signatureType: hash
componentPreload:
namespaces:
- "com/myapp"
paths:
- "src/webapp"
To run the minifying with #ui5/cli, I execute the following NPM-Script task: "test": "ui5 build preload", as the result, I get a brand new dist folder with minified and debug-friendly files (e.g. App.controller.js and App-dbg.controller.js), in addition, Component-preload.js is generated as well.
My questions:
Is Grunt-based approach a legacy, while #ui5/cli is standard approach nowadays?
Is it possible to get a minified version of the UI5 app (just a Component-preload.js) with #ui5/cli without a dist folder?
I have a Metacello configuration like ConfigurationOfAthens and I want to know which packages provides, the result would be :
Athens-Cairo
Athens-CairoPools
Athens-Core
etc.
I tried
(GoferConfigurationReference name: 'ConfigurationOfAthens') packages.
but it is not understood by the system.
It this supported in Pharo 4?
If you want just the package names you could use helper classes to query from a Configuration. And so your query would be
(MTProject
newFromVersion: (ConfigurationOfAthens project version: #development)
inConfiguration: ConfigurationOfAthens) dependenciesFilteredBy: MTPackage.
These MT classes - which sounds like they should belong to Metacello - are not in Metacello package, but currently in Versionner (included by default in Pharo images).
Diving into results reveals that some "MTPackages" has not their corresponding "RPackage" (this could be a bug, or some weird feature in the package representation models). So you would need further filtering:
((MTProject
newFromVersion: (ConfigurationOfAthens project version: #development)
inConfiguration: ConfigurationOfAthens) dependenciesFilteredBy: MTPackage)
select: [ :pkgName |
(RPackageOrganizer default
packageNamed: pkgName name asSymbol
ifAbsent: []) notNil ]
I have a custom library com.foo.library I would like to include as a dependency of a Fiori-like app I have built.
SAP Fiori Launchpad for Developers -> Best Practices for Launchpad Apps
Declare configuration information, like the location of icons, and library dependencies in the component.js configuration file
makes sense, adding my library as a dependency would look like
dependencies: {
libs: ["sap.m", "sap.ui.layout", "com.foo.library"],
components: []
},
with Fiori you have the constraint that you must use relative paths.
eg for my dependency to work it must be found at
/resources/com/foo/library
What are the steps for uploading a custom library into the ABAP SAPUI5 Repository and having it served with a relative path?
EDIT:
Currently i have the library loaded on Component.init using
sap.ui.getCore().loadLibrary("com.foo.library", "absolute path to library");
it works, however I want to set the library as a dependency
ComponentMetadata.prototype._loadDependencies = function() {
..
if (aLibraries) {
jQuery.each(aLibraries, function(i, sLib) {
jQuery.sap.log.info("Component \"" + that.getName() +
sap.ui.getCore().loadLibrary(sLib);
});
}
from code above I can see there is no option to pass in a url when the component loads the library dependencies, so i am assuming that the library has to be found relative to the resources
In your Fiori App:
Put your dependencie into the app descriptor (manifest.json) (or if no app descriptor used into the config inside the Component.js)
dependencies: {
libs: ["sap.m", "sap.ui.layout", "com.foo.library"],
components: [com.foo.component]
}
Let sap.ui.core know where to search for the namespace of your library.(Top of your Component.js)
jQuery.sap.registerModulePath("com.foo", "/Path/on/the/server/");
And now you can use your dependencies. And here is why:
Before a module is loaded, the longest registered prefix of its module
name is searched for and the associated URL prefix is used as a prefix
for the request URL. The remainder of the module name is attached to
the request URL by replacing dots ('.') with slashes ('/').
The registration and search operates on full name segments only.
Source: SAP UI5 API Documentation