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

UI5 Linter does not know / accept sap.ui.predefine or sap.ui.require.preload in bundles #248

Open
flovogt opened this issue Aug 7, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@flovogt
Copy link
Member

flovogt commented Aug 7, 2024

In a bundle file (no matter whether it's a Component-preload.js or a library-preload.js file) calls to the bundle-only APIs sap.ui.predefine or sap.ui.require.preload are reported as use of a disallowed global.

Example: https://github.com/SAP/openui5/blob/master/src/sap.ui.core/test/sap/ui/core/qunit/testdata/libraries/scenario1/lib1/library-preload.js#L2

While this might be limited to framework code, it might be fixable in a robust way. UI5 tooling adds comments to bundles that would allow to identify them

//@ui5-bundle sap/f/library-preload.js
/*!
 * OpenUI5
 * (c) Copyright 2009-2024 SAP SE ...

@codeworrior added those comments to the manually created preloads in sap.ui.core, just in case we want to use them as markers.

As the two APIs in question are not documented as public APIs (only restricted, AFAIK), they either might have to be added to the overlay or have to be listed in the linter's source (similar to the other allowed globals).

Note: This issue is assumed to be specific to framework code only. It's not likely that application code or reuse libs create (non-empty) bundles as part of the sources.

Context

  • UI5 linter version: 0.2.2
  • Node.js Version: v20.11.1
  • npm Version: 10.2.4
  • OS/Platform: macOS 14.4.1
@flovogt flovogt added the enhancement New feature or request label Aug 7, 2024
@flovogt
Copy link
Member Author

flovogt commented Aug 7, 2024

Was initially SAP-internally tracked with issue id 106.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant