Skip to content

Commit

Permalink
Merge branch 'release/V3.10.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc BURELOUX committed Oct 2, 2024
2 parents bcf252b + c33969d commit 7a4a8be
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 44 deletions.
39 changes: 0 additions & 39 deletions docs/60-Migration/33-3.9.0 TO 3.10.0.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/60-Migration/Scripts/V3.9.0_to_V3.10.0_Replacement.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ ReplaceInProject -Source $SourceFrontEnd -OldRegexp '"crudItems\$ \| async"' -Ne
ReplaceInProject -Source $SourceFrontEnd -OldRegexp '"loading\$ \| async"' -NewRegexp '"(loading$ | async) ?? false"' -Include *.html
ReplaceInProject -Source $SourceFrontEnd -OldRegexp '("[\r\n ]*)([A-z.$]+\.dictOptionDtos\$[\r\n ]*\| async)([\r\n ]*")' -NewRegexp '$1($2) ?? []$3' -Include *.html
ReplaceInProject -Source $SourceFrontEnd -OldRegexp '\[elements]="([A-z.]+)\$ \| async"' -NewRegexp '[elements]="($1$ | async) ?? []"' -Include *.html
ReplaceInProject -Source $SourceFrontEnd -OldRegexp '\[([A-z]+Options)]="([A-z.]+)\$ \| async"' -NewRegexp '[$1]="($2$ | async) ?? []"' -Include *.html
ReplaceInProject -Source $SourceFrontEnd -OldRegexp '\[([A-z]+Options)]="([\r\n ]*)([A-z.]+)\$ \| async([\r\n ]*)"' -NewRegexp '[$1]="$2($3$ | async) ?? []$4"' -Include *.html
ReplaceInProject -Source $SourceFrontEnd -OldRegexp "import { LazyLoadEvent } from 'primeng/api';" -NewRegexp "import { TableLazyLoadEvent } from 'primeng/table';" -Include *.ts
ReplaceInProject -Source $SourceFrontEnd -OldRegexp "(?-i)\bLazyLoadEvent\b" -NewRegexp 'TableLazyLoadEvent' -Include *.ts
ReplaceInProject -Source $SourceFrontEnd -OldRegexp 'frozeSelectColumn="(true|false)"' -NewRegexp '[frozeSelectColumn]="$1"' -Include *.html
Expand All @@ -202,7 +202,7 @@ ReplaceInProject -Source $SourceFrontEnd -OldRegexp "selectedCrudItems\?" -NewRe
ReplaceInProject -Source $SourceFrontEnd -OldRegexp "selectedCrudItems\?" -NewRegexp 'selectedCrudItems' -Include *.html
ReplaceInProject -Source $SourceFrontEnd -OldRegexp "\.fieldsConfig\?\.advancedFilter" -NewRegexp '.fieldsConfig.advancedFilter' -Include *.html
# This one is a bit risky, could put ngIf on things that should be effectively nullable, thus hiding the component wrongfully
#ReplaceInProject -Source $SourceFrontEnd -OldRegexp '\[(?!\bngIf\b)(?!\bappSettings\b)([A-z]+)]="(([A-z]*\.)*([A-z]+)\$ \| async)"' -NewRegexp '*ngIf="$2; let $4" [$1]="$4"' -Include *.html
#ReplaceInProject -Source $SourceFrontEnd -OldRegexp '\[(?!\bngSwitch\b)(?!\bngIf\b)(?!\bappSettings\b)([A-z]+)]="(([A-z]*\.)*([A-z]+)\$ \| async)"' -NewRegexp '*ngIf="$2; let $4" [$1]="$4"' -Include *.html

# END - strict template activation

Expand Down
11 changes: 10 additions & 1 deletion versioned_docs/version-3.10.0/60-Migration/33-3.9.0 TO 3.10.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,21 @@ sidebar_position: 1
2. This version activates the strictTemplates for projects. This will give VSCode more functionnalities, enabling the navigation from html to ts references. It forces html to respect every types. For example, if a type is nullable, you won't be able to pass it to a non nullable input in a component.
Migration should already fix a large number of typing errors but you might have to fix some more :
- | async instructions can return null so you have to fix it when the input doesn't accept nullable, either by accepting null in @Input or setting a default value with ?? operator or by not displaying component while the value is null with a *ngIf directive
* You can use that method to replace the errors :
* In VSCode, open replace in all project with Ctrl+Shift+H
* In search, paste : `\[(?!\bngSwitch\b)(?!\bngIf\b)(?!\bappSettings\b)([A-z]+)\]="(([A-z]*\.)*([A-z]+)\$ \| async)"`
* In replace value, paste : `*ngIf="$2; let $4" [$1]="$4"`
* Activate regex mode with the top right icon **Use Regular Expression** (shortcut Alt+R)
* Check every occurence of the result and :
* if there is an error because of a single object with input that can't be null, check if your input type should be typed with ` | null` and if not replace that result with the replace tool
* if there is an error because of an array of objects with input that can't be null, set a default value to the value passed to the input with `(myObservable$ | async) ?? []`
* if there is an error because of a primitive value with input that can't be null, set a default value with `(myObservable$ | async) ?? 0` for number, etc.
- if you want to pass a value to an input that is not string, you have to use the \[myInput\] instead of myInput.
Example :
`<my-component showLoader="true">` has to be replaced by `<my-component [showLoader]="true">`
You can always deactivate strictTemplates in the tsconfig.json (though unadvisable).
### BACK
1.
1. Tout ce qui concerne UserProfile été supprimé du framework dans cette version. Cette partie ne devrait pas être utilisée et peut être supprimée de vos applications si vous y faites référence.

### BUILD
1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ ReplaceInProject -Source $SourceFrontEnd -OldRegexp '"crudItems\$ \| async"' -Ne
ReplaceInProject -Source $SourceFrontEnd -OldRegexp '"loading\$ \| async"' -NewRegexp '"(loading$ | async) ?? false"' -Include *.html
ReplaceInProject -Source $SourceFrontEnd -OldRegexp '("[\r\n ]*)([A-z.$]+\.dictOptionDtos\$[\r\n ]*\| async)([\r\n ]*")' -NewRegexp '$1($2) ?? []$3' -Include *.html
ReplaceInProject -Source $SourceFrontEnd -OldRegexp '\[elements]="([A-z.]+)\$ \| async"' -NewRegexp '[elements]="($1$ | async) ?? []"' -Include *.html
ReplaceInProject -Source $SourceFrontEnd -OldRegexp '\[([A-z]+Options)]="([A-z.]+)\$ \| async"' -NewRegexp '[$1]="($2$ | async) ?? []"' -Include *.html
ReplaceInProject -Source $SourceFrontEnd -OldRegexp '\[([A-z]+Options)]="([\r\n ]*)([A-z.]+)\$ \| async([\r\n ]*)"' -NewRegexp '[$1]="$2($3$ | async) ?? []$4"' -Include *.html
ReplaceInProject -Source $SourceFrontEnd -OldRegexp "import { LazyLoadEvent } from 'primeng/api';" -NewRegexp "import { TableLazyLoadEvent } from 'primeng/table';" -Include *.ts
ReplaceInProject -Source $SourceFrontEnd -OldRegexp "(?-i)\bLazyLoadEvent\b" -NewRegexp 'TableLazyLoadEvent' -Include *.ts
ReplaceInProject -Source $SourceFrontEnd -OldRegexp 'frozeSelectColumn="(true|false)"' -NewRegexp '[frozeSelectColumn]="$1"' -Include *.html
Expand All @@ -202,7 +202,7 @@ ReplaceInProject -Source $SourceFrontEnd -OldRegexp "selectedCrudItems\?" -NewRe
ReplaceInProject -Source $SourceFrontEnd -OldRegexp "selectedCrudItems\?" -NewRegexp 'selectedCrudItems' -Include *.html
ReplaceInProject -Source $SourceFrontEnd -OldRegexp "\.fieldsConfig\?\.advancedFilter" -NewRegexp '.fieldsConfig.advancedFilter' -Include *.html
# This one is a bit risky, could put ngIf on things that should be effectively nullable, thus hiding the component wrongfully
#ReplaceInProject -Source $SourceFrontEnd -OldRegexp '\[(?!\bngIf\b)(?!\bappSettings\b)([A-z]+)]="(([A-z]*\.)*([A-z]+)\$ \| async)"' -NewRegexp '*ngIf="$2; let $4" [$1]="$4"' -Include *.html
#ReplaceInProject -Source $SourceFrontEnd -OldRegexp '\[(?!\bngSwitch\b)(?!\bngIf\b)(?!\bappSettings\b)([A-z]+)]="(([A-z]*\.)*([A-z]+)\$ \| async)"' -NewRegexp '*ngIf="$2; let $4" [$1]="$4"' -Include *.html

# END - strict template activation

Expand Down

0 comments on commit 7a4a8be

Please sign in to comment.