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

feat(illustration): use illustration name as default module export #8074

Merged
merged 6 commits into from
Jan 15, 2024

Conversation

nnaydenow
Copy link
Contributor

@nnaydenow nnaydenow commented Jan 10, 2024

Solution

Provide illustration name string as default export. This will allow developers to directly set the imported illustration name string to the ui5-illustrated-message component (as shown below) improving the DEV experience:

  • easier to determine (within the IDE) if imported illustrations are still used
  • immediate feedback (within the IDE) when import is missing for an illustration that is actually used

Changes

For the main collection of illustrations default export is illustration name (BeforeSearch) and for others collections of illustrations default export is collection name / illustration name (tnt/Calculator)

Usage

import "@ui5/webcomponents-fiori/dist/IllustratedMessage.js";
import sessionExpired from "@ui5/webcomponents-fiori/dist/illustrations/tnt/SessionExpired.js";

export default function App() {
  return (
      <ui5-illustrated-message name={sessionExpired}></ui5-illustrated-message>
  );
}

Also loaders now works with following pattern set/colletion/illustration-name (fiori/V4/UnableToLoad) instead of the old pattern colletion/illustration-name (V4/UnableToLoad)

Fixes: #8070
Fixes: #6735

@nnaydenow
Copy link
Contributor Author

nnaydenow commented Jan 10, 2024

Need to provide option to have default import as named import of illustrations imported by relative path. Follow up: #8077

@nnaydenow nnaydenow merged commit a9c0705 into main Jan 15, 2024
8 checks passed
@nnaydenow nnaydenow deleted the export-illustration branch January 15, 2024 09:10
PetyaMarkovaBogdanova pushed a commit that referenced this pull request Jan 17, 2024
…8074)

* feat(illustration): use illustration name as default module export

* chore: generate type definition for imports

* chore: fix illustration export string

* chore: fix import of js and add documentation

* chore: correct illustration loading

---------

Co-authored-by: Nayden Naydenov <nnaydenow.work@sap.com>
tsanislavgatev pushed a commit that referenced this pull request Feb 20, 2024
…8074)

* feat(illustration): use illustration name as default module export

* chore: generate type definition for imports

* chore: fix illustration export string

* chore: fix import of js and add documentation

* chore: correct illustration loading

---------

Co-authored-by: Nayden Naydenov <nnaydenow.work@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants