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

Release 1.6.0 #702

Merged
merged 31 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
871bf72
Auto update documentation
May 21, 2024
f9257ad
docs: Added ILC to the alternative solutions list
StyleT Jun 4, 2024
a0ad2c0
Merge pull request #697 from StyleT/patch-1
FlorianRappl Jun 5, 2024
a92a143
Updated deps
FlorianRappl Jun 5, 2024
4a86480
Extended fallback to provide also current messages and variables
FlorianRappl Jun 5, 2024
525efcc
Updated dets
FlorianRappl Jun 5, 2024
430fdf3
Improved blazor event listener setup
FlorianRappl Jun 6, 2024
c904605
Updated changelog
FlorianRappl Jun 6, 2024
d626400
Improved event forwarding
FlorianRappl Jun 7, 2024
19cef19
Include update
FlorianRappl Jun 10, 2024
cc32496
Included update capability
FlorianRappl Jun 10, 2024
5b348ab
Bump braces from 3.0.2 to 3.0.3
dependabot[bot] Jun 16, 2024
820137b
Merge pull request #700 from smapiot/dependabot/npm_and_yarn/braces-3…
FlorianRappl Jun 16, 2024
39928a3
Implemented strict port #699
FlorianRappl Jun 18, 2024
96ac082
Added error overlay
FlorianRappl Jun 20, 2024
c8566a8
Improved error boundary and notification
FlorianRappl Jun 21, 2024
de50a2e
Updated test
FlorianRappl Jun 21, 2024
bc7ebe4
Improved event dispatching
FlorianRappl Jun 21, 2024
225e9b3
Updated changelog
FlorianRappl Jun 21, 2024
bd3742a
Proposed fix for navigation storm (#672)
FlorianRappl Jun 25, 2024
2fd8ff4
Fixed bundler resolution for module declaration merging
FlorianRappl Jul 5, 2024
666dd88
Added issue number
FlorianRappl Jul 5, 2024
fd5ff47
Improved piral-update
FlorianRappl Jul 5, 2024
bbb6e4f
Removed dual output
FlorianRappl Jul 5, 2024
75d105c
Fixed definition of type resolution
FlorianRappl Jul 5, 2024
65ac129
Fixed wrong definition
FlorianRappl Jul 5, 2024
ea8942b
Fixed codegen paths
FlorianRappl Jul 5, 2024
79c41c5
Fixed wrong package name
FlorianRappl Jul 6, 2024
5500dd2
Fixed issue with update
FlorianRappl Jul 8, 2024
5721131
Improved lerna instructions
FlorianRappl Jul 8, 2024
1c113ff
Updated deps
FlorianRappl Jul 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Piral Changelog

## 1.6.0 (July 5, 2024)

- Fixed event dispatching for providers in `piral-blazor`
- Fixed navigation storm in angular pilets (#672)
- Fixed declaration merging for `moduleResolution` set to `bundler` (#701)
- Removed legacy `require` (CommonJS) output in `piral-core` and related libs
- Improved setup of event listeners in `piral-blazor` (#696)
- Improved fallback signature in `piral-translate`
- Improved streaming update in `piral-update`
- Updated dependencies
- Added `--strict-port` option to the `piral-cli` debug commands (#699)
- Added update capabilities to `piral-blazor` extension boundaries
- Added `piral-error-overlay` to `piral-debug-utils`
- Added `unhandled-error` event fired from the `ErrorBoundary`

## 1.5.6 (May 21, 2024)

- Fixed issue with `piral-cli-webpack5` when modifying the config entry point
Expand Down
3 changes: 2 additions & 1 deletion docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ We think that Piral hits a sweet spot that makes development easy and fun while
| TypeScript Support | ✔️ | ❌ | ✔️ | ✔️ | ❌ | ✔️ |
| Stitching Location | Client | Client | Client | Client | Server | Client |
| Free Deployments | ✔️ | ✔️ | ❌ | ✔️ | ✔️ | ✔️ |
| Free Development | ✔️ | ❌ | ❌ | ❌ | ✔️ | ❌ ||
| Free Development | ✔️ | ❌ | ❌ | ❌ | ✔️ | ❌ |
| Decoupled Sharing | ✔️ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Shared Dependencies | ✔️ | ✔️ | ✔️ | ❌ | ❌ | ❌ |

Expand All @@ -100,6 +100,7 @@ There are more alternatives, which have not been listed for brevity. Some of the
- [One App](https://github.com/americanexpress/one-app)
- [PuzzleJs](https://github.com/puzzle-js/puzzle-js)
- [NUT](https://github.com/nut-project/nut)
- [Isomorphic Layout Composer (ILC)](https://github.com/namecheap/ilc/)

## Feature Explanation

Expand Down
6 changes: 3 additions & 3 deletions docs/tutorials/23.1-monorepo-lerna.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ We begin with a new fresh directory:
```sh
git init
npm init -y
npx lerna init
npx lerna init --packages="packages/*"
```

With these three commands we
Expand Down Expand Up @@ -146,10 +146,10 @@ We moved over the `devDependencies` and added a `postinstall` script that just r
`lerna run` is a utility to run one command (if available) in all packages. Any package that has, e.g., a `declaration` script will run it when `lerna run declaration` is triggered. This is very handy for building - only specify a `build` command in each package and now you can build all packages by using `lerna run build`.
:::

Now it's time to resolve the dependencies in our monorepo. We should always use `lerna bootstrap` for this:
Now it's time to resolve the dependencies in our monorepo. We should always use the install command of the package manager for this, e.g., for Yarn:

```sh
npx lerna bootstrap
yarn install
```

If everything seems fine you can try to build your app shell for the first time:
Expand Down
10 changes: 1 addition & 9 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
"cacheableOperations": [
"build",
"build:convert",
"build:commonjs",
"build:esnext",
"build:commonjs:tsc",
"build:commonjs:system",
"build:esnext:tsc",
"build:esnext:system",
"build:codegen",
Expand All @@ -35,14 +32,9 @@
"{projectRoot}/convert.d.ts"
]
},
"build:commonjs": {
"outputs": [
"{projectRoot}/lib"
]
},
"build:esnext": {
"outputs": [
"{projectRoot}/esm"
"{projectRoot}/lib"
]
},
"build:docs": {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"underscore": "1.12.1",
"parse-url": "8.1.0",
"postcss": "8.4.31",
"pug": "^3.0.3",
"rc": "1.2.8",
"rxjs": "7.5.6",
"set-value": "4.0.1",
Expand All @@ -90,6 +91,6 @@
"tar": "^6.2.0",
"trim-newlines": "3.0.1",
"tslib": "2.5.2",
"ws": "7.4.6"
"ws": "7.5.10"
}
}
2 changes: 1 addition & 1 deletion src/converters/piral-aurelia/convert.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createConverter } from './esm/converter';
import { createConverter } from './lib/converter';

export interface HtmlComponent<TProps> {
component: {
Expand Down
27 changes: 7 additions & 20 deletions src/converters/piral-aurelia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,20 @@
"author": "smapiot",
"homepage": "https://piral.io",
"license": "MIT",
"module": "esm/index.js",
"module": "lib/index.js",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"exports": {
".": {
"import": "./esm/index.js",
"require": "./lib/index.js"
},
"./convert": {
"import": "./convert.js"
},
"./esm/*": {
"import": "./esm/*"
},
".": "./lib/index.js",
"./convert": "./convert.js",
"./lib/*": {
"require": "./lib/*"
},
"./_/*": {
"import": "./esm/*.js",
"require": "./lib/*.js"
"import": "./lib/*",
"types": "./lib/*.d.ts"
},
"./package.json": "./package.json"
},
"sideEffects": false,
"files": [
"esm",
"lib",
"src",
"convert.d.ts",
Expand All @@ -56,10 +44,9 @@
},
"scripts": {
"cleanup": "rimraf esm lib convert.d.ts convert.js",
"build": "yarn build:commonjs && yarn build:esnext && yarn build:convert",
"build": "yarn build:esnext && yarn build:convert",
"build:convert": "tsc convert.ts --skipLibCheck --declaration --module esnext",
"build:commonjs": "tsc --project tsconfig.json --outDir lib --module commonjs",
"build:esnext": "tsc --project tsconfig.json --outDir esm --module esnext",
"build:esnext": "tsc --project tsconfig.json --outDir lib --module esnext",
"typedoc": "typedoc --json ../../../docs/types/piral-aurelia.json src --exclude \"src/**/*.test.*\"",
"test": "echo \"Error: run tests from root\" && exit 1"
},
Expand Down
6 changes: 3 additions & 3 deletions src/converters/piral-blazor/convert.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createConverter } from './esm/converter';
import { createDependencyLoader } from './esm/dependencies';
import type { BlazorOptions } from './esm/types';
import { createConverter } from './lib/converter';
import { createDependencyLoader } from './lib/dependencies';
import type { BlazorOptions } from './lib/types';

export interface HtmlComponent<TProps> {
component: {
Expand Down
27 changes: 7 additions & 20 deletions src/converters/piral-blazor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,21 @@
"author": "smapiot",
"homepage": "https://piral.io",
"license": "MIT",
"module": "esm/index.js",
"module": "lib/index.js",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"exports": {
".": {
"import": "./esm/index.js",
"require": "./lib/index.js"
},
"./convert": {
"import": "./convert.js"
},
"./esm/*": {
"import": "./esm/*"
},
".": "./lib/index.js",
"./convert": "./convert.js",
"./lib/*": {
"require": "./lib/*"
},
"./_/*": {
"import": "./esm/*.js",
"require": "./lib/*.js"
"import": "./lib/*",
"types": "./lib/*.d.ts"
},
"./package.json": "./package.json"
},
"sideEffects": false,
"files": [
"infra.codegen",
"esm",
"lib",
"src",
"convert.d.ts",
Expand All @@ -59,10 +47,9 @@
},
"scripts": {
"cleanup": "rimraf esm lib convert.d.ts convert.js",
"build": "yarn build:commonjs && yarn build:esnext && yarn build:convert",
"build": "yarn build:esnext && yarn build:convert",
"build:convert": "tsc convert.ts --skipLibCheck --declaration --module esnext",
"build:commonjs": "tsc --project tsconfig.json --outDir lib --module commonjs",
"build:esnext": "tsc --project tsconfig.json --outDir esm --module esnext",
"build:esnext": "tsc --project tsconfig.json --outDir lib --module esnext",
"typedoc": "typedoc --json ../../../docs/types/piral-blazor.json src --exclude \"src/**/*.test.*\"",
"test": "echo \"Error: run tests from root\" && exit 1"
},
Expand Down
31 changes: 12 additions & 19 deletions src/converters/piral-blazor/src/converter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { BaseComponentProps, Disposable, ForeignComponent } from 'piral-core';
import { addGlobalEventListeners, attachEvents, removeGlobalEventListeners } from './events';
import { attachLocalEvents } from './events';
import {
activate,
deactivate,
Expand Down Expand Up @@ -76,18 +76,18 @@ export function createConverter(
language?: LanguageOptions,
logLevel?: BlazorLogLevel,
) {
let configurable = false;
const bootLoader = createBootLoader(bootConfig.url, bootConfig.satellites);
const boot = (opts?: WebAssemblyStartOptions) =>
bootLoader(opts).then(async (res) => {
const [_, capabilities] = res;
bootLoader(opts).then(async ({ config, first }) => {
const [_, capabilities] = config;
configurable = capabilities.includes('configurable');

if (capabilities.includes('logging')) {
if (typeof logLevel === 'number') {
await setLogLevel(logLevel);
}
if (typeof logLevel === 'number' && capabilities.includes('logging')) {
await setLogLevel(logLevel);
}

if (capabilities.includes('events')) {
if (first && capabilities.includes('events')) {
const eventDispatcher = document.body.dispatchEvent;

// listen to all events for forwarding them
Expand Down Expand Up @@ -119,7 +119,7 @@ export function createConverter(
}

window.dispatchEvent(new CustomEvent('loaded-blazor-core'));
return res;
return config;
});
let loader = !lazy && boot(opts);
let listener: Disposable = undefined;
Expand All @@ -146,27 +146,21 @@ export function createConverter(
const nav = ctx.navigation;
el.setAttribute('data-blazor-pilet-root', 'true');

addGlobalEventListeners(el);

locals.state = 'fresh';
locals.next = noop;
locals.dispose = attachEvents(
locals.dispose = attachLocalEvents(
el,
(ev) => {
ev.stopPropagation();
const { target, props } = ev.detail;
const { target, props, configure } = ev.detail;
piral.renderHtmlExtension(target, props);
configurable && configure();
},
(ev) => {
ev.stopPropagation();
const { to, state, replace } = ev.detail;
replace ? nav.replace(to, state) : nav.push(to, state);
},
(ev) => {
ev.stopPropagation();
const { type, args } = ev.detail;
piral.emit(type, args);
},
);

function mountClassic(config: BlazorRootConfig) {
Expand Down Expand Up @@ -243,7 +237,6 @@ export function createConverter(
});
},
unmount(el, locals: BlazorLocals) {
removeGlobalEventListeners(el);
el.removeAttribute('data-blazor-pilet-root');
locals.dispose();
enqueueChange(locals, locals.unmount);
Expand Down
Loading
Loading