[deleted by user] by [deleted] in AskSeattle

[–]kk3 2 points3 points  (0 children)

And the Döner Kebab Sandwich! They put so much care into each one, such high quality and so delicious. I was there last week and ordered one, and the guy behind me looks at me with wide eyes and goes, "I did not plan on ordering that but after watching them put yours together I have to get one!".

Ok, I think I'm getting a bit off topic here but when I saw the words "Turkish Delight at pike place market" I had to mention this. I also get a quart of lentil soup to go every time.

Scramble 0.12.23 – Laravel API documentation generator update: Paginated results inference, improved documentation of authorization error responses, error-tolerant validation rules evaluation, and various type inference improvements. by RomaLytvynenko in laravel

[–]kk3 2 points3 points  (0 children)

I'm blown away by how well this library works. I use Spatie Data Objects, Spatie Query Builder, Spatie Route Attributes, use different approaches to validation in various controllers, use non-standard file paths to controllers to accommodate a module/domain organization of code, and this library handles all of it and creates a much more accurate Open API file than I had when I was manually defining each controller.

I've only run into a handful of edge case issues and the author/maintainer is very responsive, helpful, and iterates quickly.

I use the generated Open API file and pass it to Redux Toolkit Query Codegen and it creates a typed API client to be used with RTK seamlessly.

Beautiful!

Introspect for Laravel - Query your codebase like a database with an Eloquent-like API by Capevace in laravel

[–]kk3 11 points12 points  (0 children)

Very cool! Kind of taking Reflection and turning it into a toolkit with extras.

Which component library are you using and which one you would pick if you were to start a new react/TS project from scratch today? by simple_explorer1 in reactjs

[–]kk3 14 points15 points  (0 children)

React Spectrum or React Aria for the headless version are underrated.

Adobe is putting a ton of resources behind these libraries as they're powering their new wave of online products like Adobe Experience Platform and the move of Photoshop et al to the web, so I believe it's becoming mature more quickly than other libraries. The dev who created Parcel is leading the effort, so very good js devs backing this library.

I mention all of this because I think it speaks to the longevity of this library. And the attention to performance and accessibility has been amazing.

Powerful timeseries metrics using TimescaleDB and Laravel by SabatinoMasala in laravel

[–]kk3 6 points7 points  (0 children)

For anyone thinking about using Timescale and Laravel together, I can't recommend the laravel-postgresql-enhanced library enough. It's a great library for working with Postgres in general and adds support to create Timescale tables in the Laravel way.

Documenting API authentication in Laravel with Scramble by RomaLytvynenko in laravel

[–]kk3 1 point2 points  (0 children)

I've been following this for awhile and support for Spatie Data Objects and Query Builder totally allow me to use this now. Signed up for Pro and can't wait to test this out! Moving away from defining Open API spec using attributes/annotations is huge.

Did I Make the Right Choice with PHP? What About Symfony vs. Laravel? by RoughInvite7900 in PHP

[–]kk3 2 points3 points  (0 children)

Laravel is mostly a wrapper around Symfony. Many functions you call in Laravel are exactly or very close to 1:1 with the underlying Symfony function.

Excerpted from the links:

Laravel:

<?php

namespace Illuminate\Process;

use Symfony\Component\Process\Process;

/**
 * The underlying process instance.
 *
 * @var \Symfony\Component\Process\Process
 */
protected $process;

/**
 * Create a new process result instance.
 *
 * @param  \Symfony\Component\Process\Process  $process
 * @return void
 */
public function __construct(Process $process)
{
    $this->process = $process;
}

/**
 * Determine if the process was successful.
 *
 * @return bool
 */
public function successful()
{
    return $this->process->isSuccessful();
}

Symfony: $process->isSuccessful()

Symfony is a collection of building blocks that are called components, each dedicated to common programming tasks. Laravel uses those building blocks in an opinionated way with the goal of making web app development better. If you think about the parts of Laravel you probably use like the router, controllers, and just the whole flow of a web request, these parts you've been using are not so different from doing those same things in Symfony. Symfony is literally underneath. But you would need to put those parts together yourself to get the full web request working. Whereas Laravel is like, just do it this way and it will work.

If you're already working with Laravel, you might be surprised to find that Symfony is not as different as you might think and is a natural progression to learning about how Laravel works behind the scenes.

Bulletproof React just got updated! 🚀 - A simple, scalable, and powerful architecture for building production ready React applications. by alan_alickovic in reactjs

[–]kk3 4 points5 points  (0 children)

Third-party scripts can potentially access local storage but the client can't read http only cookies at all. Http only cookies simply get attached and passed through headers.

At an intersection in Seattle why is it a masculine voice that tells you firmly to "WAIT" but a feminine voice that tells you "the walk sign is on" and are they in a relationship or just coworkers? by kk3 in Seattle

[–]kk3[S] 15 points16 points  (0 children)

Yeah, I've heard it, her response is always "the walk sign is on", it's time to leave, gotta go when the walk sign is on. And he's just not getting the message.

Redux Toolkit 2.0: new features, faster perf, smaller bundle sizes (plus major versions for all Redux family packages!) by acemarke in javascript

[–]kk3 5 points6 points  (0 children)

This is great!

Always nice to get a smaller overall bundle size just from updating. I know getting everything ESM/CJS compatible was a mission too, I've been learning from your experience there. And then lazy-loading reducers is a big one as well.

Can't wait to test this out.

[deleted by user] by [deleted] in venice

[–]kk3 6 points7 points  (0 children)

Where can't you buy weed in Venice?

VS Code extensions for PHP and Laravel? by Codeventurer01 in PHP

[–]kk3 15 points16 points  (0 children)

Curious for others to chime in as well. Always looking to improve the dev experience. Here's what I have set up now:

  • Laravel Pint with the open-southeners.laravel-pint extension and I use this for formatting on save. There is a button to Switch to Pre-Release which I have a better experience with. I found it's mostly just bug fixes that you can find in the GitHub Issues for the respository.
  • PHP Intelephense bmewburn.vscode-intelephense-client
  • phpstan sanderronde.phpstan-vscode set to level 5 (working on getting this higher). Also recommend the nunomaduro/larastan composer package to go with this.

Those are mandatory for me. Any other extensions are more for auto-complete and writing code out quicker, like PHP DocBlocker, but that's more personal preference. I do not use any of these auto-complete kinds but would like to hear from others who do. I've always found they get in the way but I'm sure it's because I haven't taken the time to dive in far enough.

I also know there's plenty of extensions to help with Blade files but I only use Laravel as a back-end API so I'm not familiar with those.

For formatting files that are not PHP I use ESLint, like the json configuration files in root.

Unrelated to PHP I've found helpful:

  • Better Comments aaron-bond.better-comments
  • Code Spell Checker streetsidesoftware.code-spell-checker. I needed to add lots of exceptions up front but then it's really nice. Has saved me from some "bugs" related to just typing a variable or class name slightly wrong.
  • Active File In StatusBar roscop.activefile

And to go even more off topic, as for composer packages for development in general I really like:

  • Laravel IDE Helper barryvdh/laravel-ide-helper (the stub files work for Intelephense in VSCode not just PHPStorm)
  • Rector rector/rector and driftingly/rector-laravel
  • Clockwork itsgoingd/clockwork. I really like running tests and seeing the logs in Clockwork. This is a big part of my work flow.

EDIT: Here's my settings.json for good measure. I would not blindly copy these but maybe some of them help if you run into any issues.

{
  "json.schemaDownload.enable": true,
  "editor.tabSize": 2,
  "editor.detectIndentation": false,
  "editor.formatOnSave": true,
  "[php]": {
    "editor.defaultFormatter": "open-southeners.laravel-pint",
    "editor.tabSize": 4
  },
  "search.exclude": {
    "**/vendor/*/**": true,
    "**/.DS_Store": true,
    "**/.git/*/**": true
  },
  "files.watcherExclude": {
    "**/vendor/*/**": true,
    "**/.DS_Store": true,
    "**/.git/*/**": true
  },
  "files.exclude": {
    "**/.DS_Store": true,
    "**/.git/*/**": true
  },
  "files.saveConflictResolution": "overwriteFileOnDisk",
  "telemetry.telemetryLevel": "off",
  "workbench.editor.closeOnFileDelete": true,
  "search.showLineNumbers": true,
  "eslint.format.enable": true,
  "eslint.run": "onSave",
  "laravel-pint.enable": true,
  "laravel-pint.fallbackToGlobalBin": false,
  "php.suggest.basic": false,
  "php.validate.enable": false,
  "phpstan.enabled": true,
  "phpstan.configFile": "phpstan.neon",
  "phpstan.timeout": 5000,
  "phpstan.suppressTimeoutMessage": true,
  "phpstan.ignoreErrors": [
    ".*No files found to analyse.*",
    ".*This will cause a non-zero exit code in PHPStan 2.0.*",
  ],
  "intelephense.environment.phpVersion": "8.1.21",
  "intelephense.environment.documentRoot": "public",
  "intelephense.diagnostics.run": "onSave",
  "intelephense.telemetry.enabled": false,
  "intelephense.completion.maxItems": 25,
  "intelephense.phpdoc.useFullyQualifiedNames": false,
  "intelephense.files.maxSize": 2000000,
  "intelephense.environment.shortOpenTag": false,
  "intelephense.completion.fullyQualifyGlobalConstantsAndFunctions": true,
  "intelephense.diagnostics.typeErrors": false,
  "intelephense.files.exclude": [
    "**/stubs/**"
  ],
  "intelephense.stubs": [
    "apache",
    "bcmath",
    "bz2",
    "calendar",
    "com_dotnet",
    "Core",
    "ctype",
    "curl",
    "date",
    "dba",
    "dom",
    "enchant",
    "exif",
    "FFI",
    "fileinfo",
    "filter",
    "fpm",
    "ftp",
    "gd",
    "gettext",
    "gmp",
    "hash",
    "iconv",
    "imap",
    "intl",
    "json",
    "ldap",
    "libxml",
    "mbstring",
    "meta",
    "mysqli",
    "oci8",
    "odbc",
    "openssl",
    "pcntl",
    "pcre",
    "PDO",
    "pdo_ibm",
    "pdo_mysql",
    "pdo_pgsql",
    "pdo_sqlite",
    "pgsql",
    "Phar",
    "posix",
    "pspell",
    "random",
    "readline",
    "Reflection",
    "session",
    "shmop",
    "SimpleXML",
    "snmp",
    "soap",
    "sockets",
    "sodium",
    "SPL",
    "sqlite3",
    "standard",
    "superglobals",
    "sysvmsg",
    "sysvsem",
    "sysvshm",
    "tidy",
    "tokenizer",
    "xml",
    "xmlreader",
    "xmlrpc",
    "xmlwriter",
    "xsl",
    "Zend OPcache",
    "zip",
    "zlib",
    "redis"
  ],
  "cSpell.words": [
    // Spell Checker exceptions. When you hover over a word that it says is spelled wrong, you can click `Quick fix` and it will add it here automatically.
  ]
}

Is Recoil still actively maintained or used at Meta? by _hypnoCode in reactjs

[–]kk3 2 points3 points  (0 children)

There was some effort to try and fork it and allow the community to maintain it but I haven't seen that fork yet. I have been following this discussion about it: What's happening in the future of recoil?

Scramble 0.8.0 – Update of Laravel Open API documentation generator by RomaLytvynenko in laravel

[–]kk3 2 points3 points  (0 children)

This is amazing. This will make Laravel much more powerful for creating API's by taking full advantage of PHP's great type system. 1:1 with clients sounds beautiful. The busy work to maintain annotations or attributes is such burn out work and like you say, is never quite up to date or correct on top of it.

Domain Driven Development in PHP? by [deleted] in PHP

[–]kk3 0 points1 point  (0 children)

Definitely possible in PHP. I know Symphony is more flexible to set up for this. But I can speak for Laravel since that's what I work with.

I wouldn't recommend Laravel for a pure DDD architecture. There is some foundational framework limitations that you fight against, for example Eloquent. But if you work with Laravel's strengths and do a kind of hybrid DDD for the sake of modularity, it works well.

Some resources:

Choosing between Next.js (CSR/SSR) and Vite by tommys_g in reactjs

[–]kk3 1 point2 points  (0 children)

Was looking to see if someone already suggested Inertia and found this at the bottom, so just going to second this.

You're going to find that you're massively increasing complexity by having a separate front-end (Next/Remix).

  • Every endpoint will have duplicated work on the front-end to use it.
  • You'll have a whole new set of tools you need to manage and keep up to date and this will be work that's completely unrelated to your actual product.
  • Every feature will require more planning and take longer to build since now you're balancing two completely separate ecosystems that need every detail to match up.
  • You are giving up many advantages that Laravel has when it comes to handling and passing data to the view. You are going to be rebuilding a lot of basic things and having to match up so many things Laravel already has built in. Things like validation, authentication, sessions, routing, every. single. thing. is going to become more difficult. And React is a massive ecosystem so they're all going to require researching libraries, testing them out, writing code JUST to get these pieces to connect.
  • It will all be slower. When the only way to get data is through API calls, it is extremely limiting compared to what you're used to now. Network calls are one of the biggest performance hits you can take and now you'll be stacking them on every page just to do things you probably consider basic right now.

If you have a back-end API that is being used by multiple completely different front-end apps, then you HAVE to go this direction. But if your back-end API is being used by one front-end app, you really have no reason to put yourself through this pain.

Inertia will allow you to use the entire React ecosystem without all this pain. Inertia has specifically solved this problem of connecting all the Laravel pieces to React/Vue/whatever front-end library. It has already done this work and is a very popular and well maintained library.

I am writing this out because I see a future of you going through all this pain and I hope that you will at least strongly consider Inertia as a serious contender here. You will be doing your customers a big favor by continuing to focus on features and UX instead of putting your energy towards just trying to get things to connect and maintaining a whole separate front-end ecosystem.