DCE modular development & distributable libs #65
sashafirsov
started this conversation in
Ideas
Replies: 1 comment
-
tag definitions overlapTill the scoped registriess are in place, DCE embedding with same tag names are going to be in conflict. But even with scoped registry, the library concept as coherent web components collection can not be solved without Possible solution
work arounduse the guideline for prefixing the library components. Not reliable, still only way as of now without scoped and namespaced registry. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
modules, packages, dependencies
dependencies mechanics
DCE as any another programming language module would need to
Web standards come up with solution for JavaScript modules: importmap. Which logic and API is sufficient for DCE modular needs.
static import
The static import in JS modules matches the use of
src
attribute incustom-element
.access to resolved URL
The access for other than DCE modules resources like images would need the resolved URL available in template. The
import.meta.resolve(path)
given the resolved URL for consumption by JS. Incustom-element
the implementation does not provide the direct access to JavaScript for security and performance reasons. Instead,$module-url
reserved variable is injected by template loader. This variable can be used asbase-url
to resolve relative path bylocation-element
.But
location-element
is a reflection of Location and not aware of import map for package resolution.module-url
implements theimport.meta.resolve( path )
API and exposes it in named dataslice
.Relative path( started with dot
.
) is resolved by URL API with module url as the base, the symbolic names and absolute URLs are resolved byimport.meta.resolve( path )
.Internally the xml:base attribute is set on
dce-root
to be used bymodule-url
as the resolution base for relative path. It can be used for troubleshooting in dev tools.Beta Was this translation helpful? Give feedback.
All reactions