You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: general/app/upgrading/plugins-upgrade-guide.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,20 @@ Depending on which version of the app you're upgrading from, you'll need to go t
18
18
19
19
Other than the changes outlined in this document, there may be smaller API changes that aren't highlighted here. Make sure to check the [UPGRADE.md](https://github.com/moodlehq/moodleapp/blob/latest/UPGRADE.md) file for an exhaustive list with all the changes.
20
20
21
+
## 5.0 to 5.1
22
+
23
+
In this version, the app has undergone a major framework modernization. The most significant change is the upgrade of **Angular from v17 to v20**.
24
+
25
+
### Angular 20 Upgrade
26
+
27
+
This is a major jump that aligns the app with the latest web standards and performance improvements. While Angular 20 maintains backward compatibility for many patterns, there is a key area you should review in your site plugins:
28
+
29
+
**[New Control Flow Syntax](https://v20.angular.dev/guide/templates/control-flow):** Angular 20 stabilizes the modern control flow syntax. We recommend replacing structural directives like `*ngIf`, `*ngFor`, and `[ngSwitch]` with the new `@if`, `@for`, and `@switch` blocks. We strongly recommend migrating to this new syntax as it offers better performance, improved type safety, and is the current standard for Angular development, while the old directives have been deprecated. This new control flow can be used since Moodle app 4.4.
30
+
31
+
Make sure to test your plugin thoroughly, especially any custom templates that might be affected by in newer Angular versions. Refer to the official Angular upgrade guide for a detailed list of breaking changes between v17 and v20.
32
+
33
+
**Note for developers:** Please remember to check the [UPGRADE.md](https://github.com/moodlehq/moodleapp/blob/latest/UPGRADE.md) file regularly for any deprecated methods or classes within the Moodle App API to ensure your plugin remains compatible with future releases.
34
+
21
35
## 4.4 to 4.5
22
36
23
37
The Ionic version has been upgraded to v8 (from v7), make sure to check the relevant upgrade guides for [v8](https://ionicframework.com/docs/updating/8-0). In particular, the legacy syntax to declare input labels that was deprecated on Ionic7 now has been removed.
Copy file name to clipboardExpand all lines: general/development/policies/codingstyle-moodleapp.md
+8-69Lines changed: 8 additions & 69 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -601,37 +601,9 @@ There is a maximum line length of 140 characters for templates. Whenever that le
601
601
If you are using VSCode, this should be done automatically on every save with the [configuration that ships with the app](https://github.com/moodlehq/moodleapp/blob/latest/.vscode/settings.json#L8).
602
602
:::
603
603
604
-
### Avoid default exports
605
-
606
-
Using default exports should be avoided for Angular applications because they [cause issues with AOT compiler](https://stackoverflow.com/questions/45962317/why-isnt-export-default-recommended-in-angular). Technically only components have this problem, but in order to avoid the mental load of thinking about this every time, we disallow it altogether.
607
-
608
-
<ValidExampletitle="Good">
609
-
610
-
```ts
611
-
@Component({
612
-
selector: 'my-component',
613
-
templateUrl: 'my-component.html',
614
-
})
615
-
exportclassMyComponent {}
616
-
```
617
-
618
-
</ValidExample>
619
-
620
-
<InvalidExampletitle="Bad">
621
-
622
-
```ts
623
-
@Component({
624
-
selector: 'my-component',
625
-
templateUrl: 'my-component.html',
626
-
})
627
-
exportdefaultclassMyComponent {}
628
-
```
629
-
630
-
</InvalidExample>
631
-
632
604
### Declaring page modules
633
605
634
-
When creating a page component, it should be declared in the feature's [lazy modules](../../../general/app/development/development-guide.md#routing). Exceptionally, pages that are used by more than one module can create a page module; but this module should only declare components, it shouldn't include any routing functionality.
606
+
When creating a page component, it should be declared as a standalone component and exported as default class so it can be easily [lazy loaded](../../../general/app/development/development-guide.md#routing).
635
607
636
608
<ValidExampletitle="Good">
637
609
@@ -640,66 +612,33 @@ When creating a page component, it should be declared in the feature's [lazy mod
0 commit comments