question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Server is not considering application dependency

See original GitHub issue

Expected Behavior

If you are developing on a library (or future component types see related issue https://github.com/SAP/ui5-tooling/issues/45) and you add an application project as a dependency or devDependency, the application dependency should be served as the server root.

Also the dependent applications index.html etc. should be served.

Current Behavior

Currently the application dependency is not served at all when beeing added as a dependency.

The application appears in ui5 tree, but it’ll still not be served.

Steps to reproduce the issue

  1. Create a library project
  2. Add a application project as dependency
  3. Try to serve

Affected components

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
RandomBytecommented, Nov 15, 2018

Hi Kristian,

Thank you for your input.

I’ll try to clarify some points:

Why should the ui5-project module care about the project type? As I see it, the ui5-project module should build the dependency tree just by following the specific rules of the translator in use.

The translators create a mostly unopinionated dependency tree.

The projectPreprocessor takes in that dependency tree and enriches it with project specific configurations. These configurations are partially type-dependent. For example a webapp-directory configuration is only possible in projects of type application. Therefore, type-specific “formatters” are being used to configure the projects.

Finally, the normalizer uses a translator and the projectPreprocessor to provide a configured dependency tree that can be used by the ui5-builder and ui5-server.

I would expect the root element of the tree output by the ui5-project module, should always be the project, in which the tree is generated for, again, regardless of the type of the project!

This is the case and will continue to be the case. Technically there is no need for an application project to be the root project. It was just a restriction we put in place for the time being.

Background: application projects do not have a namespace. This means their resources are always mapped to the root (/) path. Multiple application projects in the same tree would therefore probably end up having resource clashes (e.g. for two application projects, both index.html files would be mapped to the path /index.html).

To prevent this we currently ignore all application projects that are not the root project. We will change this with SAP/ui5-project#62 to support use cases like yours. The new logic basically ignores all application projects but the one closest to the root (not necessarily the root project).

Note that the mapping between physical and virtual paths is done by ui5-fs. ui5-builder and ui5-server facilitate ui5-fs. They throw in a project tree and get a “virtual” file system in return. This means ui5-server does not deal with any path mapping, it just serves the ui5 file system. Currently, ui5-server does not even look at the type of any projects.

if executed on projectB. The ui5-server module could then apply some logic based on the project type (because why should the ui5-project module “assume” that only application projects can be executed by the server?). The logic could be something like:

ui5-fs doesn’t really care about the position of a project in the tree. An application project is always mapped to the root (/) (as configured by the ApplicationFormatter during project preprocessing in ui5-project).

Therefore, after the “application project must be root”-restriction has been lifted with SAP/ui5-project#62, starting the server in projectA will have the same effect as starting it in projectB.

0reactions
RandomBytecommented, Nov 17, 2018

Fix can be tested with UI5 CLI v0.2.4

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Way to keep minimal application-server dependency?
1. Agree. · No, the format to specify the location of a JNDI server is not different. The values are though. · Thanks...
Read more >
Understanding Application Dependencies
Application Dependencies occur when technology components, applications, and servers rely on one another to provide a business solution or service.
Read more >
10 Installing and Configuring Application Dependency and ...
Collect the following application server information: admin server host ... Select the location to install into when prompted, do not create links.
Read more >
Specifying external dependencies to applications running on ...
This document details the steps to specify external dependencies to applications running on WebSphere® Application Server Community Edition.
Read more >
Application Dependency Mapping: The Complete Guide
And this makes sense when you consider that an application dependency map is basically a visual representation of the different servers used by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found