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

update laravel ui and bootstrap version #81

Merged

Conversation

RoduanKD
Copy link
Contributor

@RoduanKD RoduanKD commented Aug 8, 2022

Hello!
I'm working on this now and here's the required todo

  • update bootstrap and laravel/ui in the install command
  • update vite.config.js with new ~bootstrap alias
  • update app.blade.php and guest.blade.php in all themes with vite directive
    • Admin LET (no change required)
    • Core UI
    • Plain Admin
    • SB admin 2
    • tabler
    • voltbs5
  • replace require with import since Vite doesn't support it

@RoduanKD RoduanKD mentioned this pull request Aug 8, 2022
@krekas
Copy link
Contributor

krekas commented Aug 8, 2022

@RoduanKD keep in mind that there's very big chance not all themes will work only by changing to @vite directive.

@RoduanKD RoduanKD marked this pull request as ready for review August 13, 2022 13:58
@RoduanKD
Copy link
Contributor Author

I've tested manually all laravel/ui themes. all of them are fine except for Volt. please give it a second check @PovilasKorop @krekas. I'm not sure if the problem is from my side or no.

error details:

D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:27142
      throw error;
      ^

Invalid argument(s): Uri d:%5Claragon%5Cwww%5Clarastarters%5Cnode_modules%5C@fortawesome%5Cfontawesome-free%5Cscss%5Csolid.scss must have scheme 'file:'.
    at Object.wrapException (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:1235:17)
    at WindowsStyle.pathFromUri$1 (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:32890:17)
    at StaticClosure.fromUri (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:16100:37)
    at Object.NullableExtension_andThen0 (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:18332:40)
    at Object._wrapException (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:12997:14)
    at _render_closure1.call$2 (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:81147:21)
    at _RootZone.runBinary$3$3 (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:27268:18)
    at _FutureListener.handleError$1 (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:25818:19)
    at _Future__propagateToListeners_handleError.call$0 (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:26116:49)
    at Object._Future__propagateToListeners (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:4539:77) {
  dartException: <ref *1> ArgumentError {
    _hasValue: false,
    invalidValue: null,
    name: null,
    message: "Uri d:%5Claragon%5Cwww%5Clarastarters%5Cnode_modules%5C@fortawesome%5Cfontawesome-free%5Cscss%5Csolid.scss must have scheme 'file:'.",
    '$thrownJsError': <ref *2> Invalid argument(s): Uri d:%5Claragon%5Cwww%5Clarastarters%5Cnode_modules%5C@fortawesome%5Cfontawesome-free%5Cscss%5Csolid.scss must have scheme 'file:'.
        at Object.wrapException (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:1235:17)
        at WindowsStyle.pathFromUri$1 (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:32890:17)
        at StaticClosure.fromUri (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:16100:37)
        at Object.NullableExtension_andThen0 (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:18332:40)
        at Object._wrapException (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:12997:14)
        at _render_closure1.call$2 (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:81147:21)
        at _RootZone.runBinary$3$3 (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:27268:18)
        at _FutureListener.handleError$1 (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:25818:19)
        at _Future__propagateToListeners_handleError.call$0 (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:26116:49)
        at Object._Future__propagateToListeners (D:\laragon\www\larastarters\node_modules\sass\sass.dart.js:4539:77) {
      dartException: [Circular *1],
      '$cachedTrace': _StackTrace {
        _exception: [Circular *2],
        _trace: "Invalid argument(s): Uri d:%5Claragon%5Cwww%5Clarastarters%5Cnode_modules%5C@fortawesome%5Cfontawesome-free%5Cscss%5Csolid.scss must have scheme 'file:'.\n" +
          '    at Object.wrapException (D:\\laragon\\www\\larastarters\\node_modules\\sass\\sass.dart.js:1235:17)\n' +
          '    at WindowsStyle.pathFromUri$1 (D:\\laragon\\www\\larastarters\\node_modules\\sass\\sass.dart.js:32890:17)\n' +
          '    at StaticClosure.fromUri (D:\\laragon\\www\\larastarters\\node_modules\\sass\\sass.dart.js:16100:37)\n' +
          '    at Object.NullableExtension_andThen0 (D:\\laragon\\www\\larastarters\\node_modules\\sass\\sass.dart.js:18332:40)\n' +
          '    at Object._wrapException (D:\\laragon\\www\\larastarters\\node_modules\\sass\\sass.dart.js:12997:14)\n' +
          '    at _render_closure1.call$2 (D:\\laragon\\www\\larastarters\\node_modules\\sass\\sass.dart.js:81147:21)\n' +
          '    at _RootZone.runBinary$3$3 (D:\\laragon\\www\\larastarters\\node_modules\\sass\\sass.dart.js:27268:18)\n' +
          '    at _FutureListener.handleError$1 (D:\\laragon\\www\\larastarters\\node_modules\\sass\\sass.dart.js:25818:19)\n' +
          '    at _Future__propagateToListeners_handleError.call$0 (D:\\laragon\\www\\larastarters\\node_modules\\sass\\sass.dart.js:26116:49)\n' +
          '    at Object._Future__propagateToListeners (D:\\laragon\\www\\larastarters\\node_modules\\sass\\sass.dart.js:4539:77)'
      }
    }
  }
}

@krekas
Copy link
Contributor

krekas commented Aug 13, 2022

@RoduanKD your error is with fontawesome. It cannot find manifest file. I think it could be manifest

@RoduanKD
Copy link
Contributor Author

this issue was related to sass according to this I need to update sass to 1.38. it fixes the problem but puts me back one step because as of sass:1.32, using / operator is not allowed and shows a deprecation notice. I fixed the deprecations that are coming from volt (using sass-migrator) and the ones that are left are the ones coming from font awesome

Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(20em, 16) or calc(20em / 16)

More info and automated migrator: https://sass-lang.com/d/slash-div

   ╷
12 │ $fa-fw-width:          (20em / 16);
   │                         ^^^^^^^^^
   ╵
    node_modules\@fortawesome\fontawesome-free\scss\_variables.scss 12:25  @import
    node_modules\@fortawesome\fontawesome-free\scss\fontawesome.scss 5:9   @import
    resources\sass\app.scss 1:9                                            root stylesheet

@RoduanKD
Copy link
Contributor Author

PS: with the above fix it's working with deprecation notice for font awesome files. @krekas
image

@krekas
Copy link
Contributor

krekas commented Aug 13, 2022

@RoduanKD I checked your pr.

  1. adminlte isn't working. Can't open dropdowns. And console shows error
    image
  2. coreui everything works.
  3. plainadmin dropdown also not working
  4. volt dropdown again
  5. sb admin 2 also dropdowns. Getting jquery error in console
    image
  6. tabler everything seems working

@RoduanKD
Copy link
Contributor Author

thanks for your check @krekas:

  1. adminlte is fixed
  2. plainadmin is fixed
  3. volt is fixed
  4. sb admin 2: sidebar toggle is working now and the jQuery error is gone but the dropdown didn't work and I didn't get why is that happening!

@krekas
Copy link
Contributor

krekas commented Aug 14, 2022

@RoduanKD

  1. adminlte dropdown works only for menu, where user is doesn't
  2. volt gives font error. I think it would be great to fix it
    image
  3. sb admin 2 is made using bootstrap 4. When downgraded works. I can't push directly to pr here so make these changes.
    In replaceWithSBAdmin2() function at the start add
// NPM Packages...
$this->updateNodePackages(function ($packages) {
    return [
        "bootstrap" => "^4.6.2",
    ] + $packages;
}, dev: true);

In guest.blade.php replace css with @vite('resources/css/app.css') and in both layouts remove google fonts

@PovilasKorop
Copy link
Collaborator

@krekas ping, have you had the time to test the latest changes by @RoduanKD?

@krekas
Copy link
Contributor

krekas commented Aug 20, 2022

@PovilasKorop planning to check today

@krekas
Copy link
Contributor

krekas commented Aug 20, 2022

@RoduanKD change admin LTE npm packages to:

// NPM Packages...
$this->updateNodePackages(function ($packages) {
    return [
            'jquery'=> '^3.6.0',
            'resolve-url-loader' => '^4.0.0',
            'bootstrap' => '~4.6.1',
        ] + $packages;
}, dev: true);

this theme also uses old bootstrap version. After this fix everything works.

@PovilasKorop after this last fix green light from me.

@PovilasKorop
Copy link
Collaborator

@krekas could you maybe do it yourself and push to the branch of PR? Then we wouldn't need to wait for @RoduanKD

@krekas
Copy link
Contributor

krekas commented Aug 20, 2022

@PovilasKorop don't have permissions.

@PovilasKorop
Copy link
Collaborator

@krekas oh right, how could I forget. Ok waiting then.

@RoduanKD
Copy link
Contributor Author

RoduanKD commented Aug 20, 2022

@keras, I've downgraded bootstrap in Admin LTE and had to downgrade jQuery & popper.js, and it's working fine now. I think it's now ready @PovilasKorop

@PovilasKorop
Copy link
Collaborator

@krekas can you approve that I should merge?

@krekas
Copy link
Contributor

krekas commented Aug 22, 2022

@PovilasKorop everything should be good, green light from me

@PovilasKorop PovilasKorop merged commit 17c01b6 into LaravelDaily:main Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants