Skip to content

Conversation

@niekraaijmakers
Copy link
Contributor

@niekraaijmakers niekraaijmakers commented Jun 14, 2021

Description

Providing typed mapTo functionality

Related Issue

#47

Motivation and Context

Be able to use typesafety in MapTo and not be restricted to any, but with backwards compatibility.

How Has This Been Tested?

Unit test + local builds

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Niek Raaijmakers and others added 30 commits September 7, 2020 14:18
… generic argument with gives you a typed EditConfig.
…typed-mapTo

* commit 'f85e2fac453151a345c6040d43cdb61aadbd0fce': (29 commits)
  chore(release): 1.0.7 [skip ci]
  fix(docs): remove --mode from docs build after a typedoc breaking change
  chore(deps): update dependency @adobe/aem-spa-page-model-manager to ~1.3.0
  style(releaserc): adapt code style to eslint warnings
  chore(release): 1.0.6 [skip ci]
  fix: docs generation command typo, releasing from dist directory
  chore(release): 1.0.5 [skip ci]
  fix: proper pkgRoot for semantic-release
  chore(release): 1.0.4 [skip ci]
  ci(tslint): add tslint config
  Revert "ci(actions): use eslint action"
  ci(actions): use eslint action
  fix(package.json): cleanup
  fix(eslint): adapt code according to eslint reports
  refactor(eslint): adjust code
  chore: cleanup
  refactor: cleanup
  chore(deps): update dependency @adobe/aem-spa-page-model-manager to ~1.2.0
  ci(npm): update token
  chore: update docs location and `.gitignore`
  ...

# Conflicts:
#	src/lib/layout/aem-component.directive.spec.ts
#	src/lib/layout/component-mapping.spec.ts
#	src/lib/layout/component-mapping.ts
#	src/lib/test/mapping.ts
#	src/lib/test/test-comp1.component.ts
#	src/lib/test/test-comp2.component.ts
#	src/lib/test/test-comp3.component.ts
…apTo

* feature/lazyloadable-components-2:
  Linting fixes

# Conflicts:
#	src/lib/layout/aem-component.directive.ts
#	src/lib/layout/component-mapping.spec.ts
#	src/lib/layout/component-mapping.ts
#	src/lib/test/test-comp1.component.ts
#	src/lib/test/test-comp2.component.ts
#	src/lib/test/test-comp3.component.ts
MapTo and LazyMapTo are now typed with a generic extending
MappedComponentProperties. Use the interface MappedComponentProperties,
abstract class AbstractMappedComponent or the any type to fix your
build.

BREAKING CHANGE: 🧨 Generic Typed MapTo / LazyMapTo
Now you can lazy load your code splitted components on demand using a
Promise.
…lazyloadable-components-2

* commit '0e6a09772169325637f07ea704f630ca371402e9':
  chore(deps): update dependency @adobe/aem-spa-component-mapping to ~1.1.0
…lazyloadable-components-2

* commit '623be741d2243a86c06491081e9fc09a0d9dc7a5':
  Update CHANGELOG.md
…) unfortunately.

Instead use this approach:

LazyMapTo('lazycomponent4')(() => import('../test/lazy-component-wrapper/lazy.component').then((m) => m.LazyComponent));
…apTo

* feature/lazyloadable-components-2:
  Add unit test coverage for lazyloading directive
  Add / correct some comments
  Remove default approach, this does not work with AOT compilation (ivy) unfortunately.
  `formatting
  formatting
  formatting
  formatting
  formatting
  formatting
  Adding default support for the lazyloading so imports can be simplified
  chore(deps): update dependency @adobe/aem-spa-component-mapping to ~1.1.0
  Update CHANGELOG.md
  feat: 🎸 LazyMapTo support

# Conflicts:
#	src/lib/layout/aem-component.directive.spec.ts
#	src/lib/layout/aem-component.directive.ts
#	src/lib/layout/component-mapping.spec.ts
#	src/lib/layout/component-mapping.ts
…typed-mapTo

* commit '36f71d715a11ac7013ce2a37f42425801939d5c6':
  chore(release): 1.1.0 [skip ci]
  feat: support lazy loading
  chore: enable security check for external contribs
  chore: fix github action to not run twice

# Conflicts:
#	CHANGELOG.md
#	src/lib/layout/aem-component.directive.spec.ts
#	src/lib/layout/aem-component.directive.ts
#	src/lib/layout/component-mapping.spec.ts
#	src/lib/layout/component-mapping.ts
#	src/lib/test/lazy-component-wrapper/lazy.component.ts
#	src/lib/test/test-comp1.component.ts
#	src/lib/test/test-comp2.component.ts
#	src/lib/test/test-comp3.component.ts
formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants