Skip to content

Commit 40977e0

Browse files
committed
feat(demo): add more use cases content, fix default docs link
1 parent ee1e712 commit 40977e0

File tree

4 files changed

+71
-4
lines changed

4 files changed

+71
-4
lines changed

projects/elements-demo/src/app/features/contribute/contribute/contribute.component.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
<h1>BECOME A CONTRIBUTOR</h1>
99
<h3>Missing a feature, found bug or typo in docs?</h3>
1010
</div>
11+
1112
<br />
1213
<br />
1314
<br />
15+
1416
<p>
1517
Please, feel free to open an
1618
<a
@@ -24,3 +26,9 @@ <h3>Missing a feature, found bug or typo in docs?</h3>
2426
>
2527
to make this project better for everyone! 🤗
2628
</p>
29+
30+
<br />
31+
<br />
32+
33+
<h2>List of contributors</h2>
34+
<p>Coming soon!</p>

projects/elements-demo/src/app/features/docs/docs-routing.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { DocsComponent } from './docs.component';
66
const routes: Routes = [
77
{
88
path: '',
9-
redirectTo: 'how-it-works',
9+
redirectTo: 'getting-started',
1010
pathMatch: 'full'
1111
},
1212
{

projects/elements-demo/src/app/features/docs/use-cases/use-cases.component.html

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<div class="wrapper">
22
<h1>Use cases</h1>
33

4-
<p>Let's explore some of the use cases for this approach...</p>
4+
<p>
5+
Let's explore some of the use cases which can be solved using this
6+
library...
7+
</p>
58

69
<h2>Microfrontends style "sub-applications"</h2>
710

@@ -364,10 +367,66 @@ <h2>Microfrontends style "sub-applications"</h2>
364367
independently from release cycle of consumer applications?
365368
</blockquote>
366369

370+
<p>
371+
This is exactly what is enabled by this library! The "sub-application"
372+
element is released and deployed independently as a single file bundle which
373+
is then <strong>referenced ONLY by the url</strong> in the consumer apps.
374+
</p>
375+
376+
<p>
377+
To make referencing easier, the bundle file name can always stay the same
378+
(for example <code>some-element.js</code> without any hash) for every
379+
version of the element. The cache busting is then handled with the help of
380+
<code>etag</code> which is transparently calculated based on the file
381+
content on the server. Learn more about
382+
<a
383+
href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag"
384+
target="_blank"
385+
>ETag</a
386+
>
387+
HTTP response headers.
388+
</p>
389+
390+
<blockquote>
391+
We could still employ query params (or even file name versioning) in case we
392+
would like to have more granular control about which version of the element
393+
will be downloaded by the consumer appto facilitate stuff like A/B testing.
394+
Please note that this has to be implemented with corresponding support on
395+
the server side.
396+
</blockquote>
397+
367398
<h2>On-demand loading of a heavy 3rd party component</h2>
368399

400+
<p>
401+
Let's say we are building an Angular application and we are paying extra
402+
attention to architecture of the features making them nicely isolated and
403+
lazy loaded. The performance, maintainability and start up time of our
404+
application is great!
405+
</p>
406+
407+
<p>
408+
Then comes in a new requirement to add possibility to inline edit every item
409+
of a large list using a powerful (but also very heavy) rich text editor. As
410+
a result the size and hence loading of that feature will suffer even though
411+
the editor is only displayed as a result of user interaction and never from
412+
the start.
413+
</p>
414+
415+
<blockquote class="large">
416+
Ability to seamlessly load element once it was rendered as a result of user
417+
interaction is exactly what can be achieved using
418+
<code>*axLazyElement</code> directive!
419+
</blockquote>
420+
421+
<blockquote>
422+
Another possible solution to this problem could be by implementing custom
423+
component loader service using plain Angular. Unfortunately, currently (as
424+
of version <code>8.1.0</code>) such an approach is only possible using
425+
deprecated APIs and is pretty complex in itself...
426+
</blockquote>
427+
369428
<blockquote class="large">
370-
Did you use this library for a different use case not mentioned in this
429+
Are you thinking about some different use case not mentioned in this
371430
section? Please, let us know and open an
372431
<a href="" target="_blank">issue</a> or submit a
373432
<a href="" target="_blank">PR</a>

projects/elements-demo/src/app/features/home/home/home.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h3>
1717
<button mat-flat-button color="accent" routerLink="../docs/getting-started">
1818
Get started
1919
</button>
20-
<button mat-flat-button color="primary" routerLink="../docs">
20+
<button mat-flat-button color="primary" routerLink="../docs/how-it-works">
2121
Learn more
2222
</button>
2323
<button mat-flat-button color="warn" routerLink="../examples">

0 commit comments

Comments
 (0)