Skip to content

Commit 564ca17

Browse files
committed
Package updates and typos
1 parent 357c4e3 commit 564ca17

29 files changed

+629
-417
lines changed

README.md

+18-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
# u-front-ends
2-
Micro Front Ends
2+
A simple framework for integrating multiple [micro frontends](https://martinfowler.com/articles/micro-frontends.html) as one.
33

44
## Status
55
[![Coverage Status](https://coveralls.io/repos/github/validide/u-front-ends/badge.svg?branch=master)](https://coveralls.io/github/validide/u-front-ends?branch=master)
66
[![npm version](https://img.shields.io/npm/v/@validide/u-front-ends)](https://www.npmjs.com/package/@validide/u-front-ends)
77

8-
## Demo
8+
Not sure how production ready this project is so any feedback is appreciated.
99

10-
[Demo site](https://validide.github.io/u-front-ends/demo)
10+
## Motivation
11+
As a developer, if you have worked on the same suite of products for multiple years, you should have realized that no company will stop adding new features to the suite in order to do a complete overhaul of the technology stack. Chances are you will get the change to try new frameworks on new features/products but you will need to find a way to integrate these in the suite.
12+
13+
This project tries to capture some of the solutions I wish I had implemented along the years but did not have the time or knowledge.
14+
15+
16+
## Naming
17+
Naming stuff is one of the hardest things in programming so:
18+
* `u-front-ends` because `npm install µ-front-ends` would have been a pain to type.
19+
* this is my take (I am sure someone might come with a better one) on a client side implementation therefore the packages are prefixed with my name
20+
21+
22+
## Documentation and demos
23+
24+
* [Documentation](https://validide.github.io/u-front-ends/)
25+
* [Browser API tests](https://validide.github.io/u-front-ends/demo/browser-tests.html)
File renamed without changes.

docs/demo/css/app.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121

2222

23-
.embeded-nav-bar iframe {
23+
.embedded-nav-bar iframe {
2424
box-sizing: content-box;
2525
width: 100%;
2626
height: 56px;
File renamed without changes.

docs/demo/js/app.js

+25-15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(function (window, ufe, undefined) {
22
'use strict';
33

4-
var mfeEventHadler = function (evt) {
4+
var mfeEventHandler = function (evt) {
55
console.log(evt);
66
switch (evt.type) {
77
case 'beforeCreate':
@@ -37,16 +37,16 @@
3737
}
3838

3939
var globalHandlers = new ufe.ComponentEventHandlers();
40-
globalHandlers['beforeCreate'] = mfeEventHadler;
41-
globalHandlers['created'] = mfeEventHadler;
42-
globalHandlers['beforeMount'] = mfeEventHadler;
43-
globalHandlers['mounted'] = mfeEventHadler;
44-
globalHandlers['beforeUpdate'] = mfeEventHadler;
45-
globalHandlers['updated'] = mfeEventHadler;
46-
globalHandlers['beforeDestroy'] = mfeEventHadler;
47-
globalHandlers['destroyed'] = mfeEventHadler;
48-
globalHandlers['error'] = mfeEventHadler;
49-
globalHandlers['data'] = mfeEventHadler;
40+
globalHandlers['beforeCreate'] = mfeEventHandler;
41+
globalHandlers['created'] = mfeEventHandler;
42+
globalHandlers['beforeMount'] = mfeEventHandler;
43+
globalHandlers['mounted'] = mfeEventHandler;
44+
globalHandlers['beforeUpdate'] = mfeEventHandler;
45+
globalHandlers['updated'] = mfeEventHandler;
46+
globalHandlers['beforeDestroy'] = mfeEventHandler;
47+
globalHandlers['destroyed'] = mfeEventHandler;
48+
globalHandlers['error'] = mfeEventHandler;
49+
globalHandlers['data'] = mfeEventHandler;
5050

5151

5252
var configuration = new ufe.RootComponentOptions();
@@ -152,11 +152,11 @@
152152
mainNavBarCustomEl.resources.push(mainNavBarCustomElScript);
153153

154154
var mainNavBarIframe = new ufe.CrossWindowChildComponentOptions();
155-
mainNavBarIframe.url ='./embeded-nav-bar.html'
155+
mainNavBarIframe.url ='./embedded-nav-bar.html'
156156
mainNavBarIframe.handlers = Object.assign({}, globalHandlers, {
157157
'created': function (e) {
158158
e.el.parentElement.insertBefore(e.el, e.el.parentElement.firstChild);
159-
e.el.parentElement.classList.add('embeded-nav-bar');
159+
e.el.parentElement.classList.add('embedded-nav-bar');
160160

161161
globalHandlers['created'](e);
162162
},
@@ -165,7 +165,7 @@
165165
globalHandlers['destroyed'](e);
166166
}
167167
});
168-
mainNavBarIframe.embededAttributes = {
168+
mainNavBarIframe.embeddedAttributes = {
169169
'allowtransparency': 'true',
170170
'frameborder': 0
171171
};
@@ -228,7 +228,17 @@
228228
}
229229

230230
function bang() {
231-
window.location = ufe.getUrlFullPath(document, './index.html') + '#/';
231+
if (window.location.href.indexOf('#') !== -1) {
232+
return;
233+
}
234+
235+
var pathname = window.location.pathname;
236+
if (pathname === '/') {
237+
pathname = '/index.html';
238+
}
239+
var pathParts = pathname.split('/');
240+
241+
window.location = ufe.getUrlFullPath(document, './' + pathParts[pathParts.length - 1]) + '#_/';
232242
}
233243

234244
function initDemoHandlers() {

0 commit comments

Comments
 (0)