Toronto
Account created on 24 January 2011, over 14 years ago
  • Drupal developer/UX designer/DevOps at NeurocracyΒ 
#

Merge Requests

More

Recent comments

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Dear Drupal.org please refresh the cache for this kthx.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Added tabledrag.js item and marked tableselect.js more or less fixed.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

This has finally been merged. Only lingering issue is to figure out if we can delay Turbo caching asynchronously like we can with rendering, but we can do that separately and it can be worked around in the meantime.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Sat down and had another look at this. Turns out the initial load was still breaking the BigPipe JavaScript because doesn't handle being in the <head> and with the defer attribute well, most likely because it needs to be render blocking and kick in as early as possible.

With that figured out, I tried to exclude it from the <head> + defer, but that broke because it needs Drupal.ajax, which was still being output to the <head> with the defer attribute. At that point, I didn't want to mess with the dependency tree because the library handling is already kind of janky and gives me a headache.

So my next thought was to make a more fundamental change: since our <head> + defer is primarily for RefreshLess requests, why not just let JS be output to the footer without the defer attribute alterations on non-RefreshLess loads, i.e. the initial load. Shockingly, this completely fixed it and BigPipe's JS works as intended on the initial load, and doesn't interfere on subsequent RefreshLess loads. Because nothing in my life ever seems to be easy, my excitement was short lived, as it only works correctly with aggregation off: my clever solution seems to break assets and doesn't load most on an initial load if aggregation is enabled.

Also note that this causes JavascriptAlterTest to fail, but that can probably be fixed by mocking up the current request in setUp() with the RefreshLess header so that our request wrapper indicates this is a RefreshLess request and alterations are performed.

I've created a second branch in the issue fork for these changes in case they're not usable at all: 3519784-bigpipe-compatibility-assets. I'll get back to this at some point or someone else can finish this.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Irrelevant issue linked whoops.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

I think I have it working by decorating BigPipeStrategy in the issue branch. Will let this sit for a bit so I can test it more thoroughly another day.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

ambient.impact β†’ changed the visibility of the branch 3519784-bigpipe-compatibility-routing to hidden.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Reworked and expanded proposed solutions.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Spent the week on this because I discovered that preloading links into Turbo's cache can be a big performance boost in a lot of cases, and that requires caching to actually work. After a lot of trial and error and quite a lot of swearing, I got it to more or less working, but I'll have to test it over the following days to see if it's robust enough to merge.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Awesome. Thanks!

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

I created three merge requests, one for each of the currently supported branches. Not sure if there was a better way to do that, but there ya go. Also used Drupal core's constant that they added as part of that change record so we don't even have to know what the limit is, so if they ever decide to change it, Hux just uses the new limit.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

ambient.impact β†’ changed the visibility of the branch 3472641-wrong-module-name-limit to hidden.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

ambient.impact β†’ made their first commit to this issue’s fork.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

@iseeaflyingcrane I think you need to include the @. This works for me to send to the current user:

{{ @user.current_user_context:current_user.mail.value }}

See also #2849810: Data processors do not check type before performing type-specific operations β†’ .

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Yup, setting the language fixed it for me as well!

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

@catch Would stripping 'use strict' be a good idea, though? I'd rather my JS doesn't become less strict when aggregation is enabled, i.e. in production. Am I misunderstanding your comment?

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Not sure if this is out of scope for this issue, but what I'd love to see is an option to not just set the link content to the entity's label when it's inserted, but also have it update if I later change the title of the linked entity. A use case for this would be to have a a custom list of nodes in some other content as sort of an overview page, without having to create a view. In that case, it would be less maintenance to not have to remember to update the displayed links elsewhere that they're linked.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Closing as outdated as 2.x may work better with this. If you're still seeing this issue with 2.x, feel free to re-open.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Closing as outdated because the 2.x releases should not have this problem.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Closing as outdated; please try the 2.x branch which is a complete rewrite and shouldn't have this issue.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Closing as outdated; 2.x branch does not have this problem.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Closing as outdated. 2.x should handle pagers quite well.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Closing as outdated. See the extensive list of events in 2.x, some of which allow cancelling or delaying.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Closing as outdated. The 2.x branch now does this in the listed cases and others. See the refreshless:reload event documentation.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Closing as outdated because the 2.x releases navigate to error pages correctly.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Closing as outdated because this is included in the 2.x releases: data-turbo="false" can be added to links, buttons, or entire containers, and data-turbo="true" can be added to re-enable on specific links, buttons, and descendants; see Turbo attributes documentation. I'm also planning on adding more info about this to our documentation when time permits.

Also note that we have a refreshless:click event that can be cancelled on a case by case basis.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Closing as outdated. Please see the 2.x releases which now apply to the admin section and for all users - including authenticated users.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

I'm going to close this as outdated but feel free to re-open if you're still having issues. A ton of work has gone into 2.x and we now have a fairly robust basic implementation in our alpha releases.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Added Mink and Ajax testing links.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

I created a new branch in the issue fork to try fixing the cron ordering as suggested by @megachriz but I can't get it to work, so I've pushed what I have so far because I need to go work on other stuff but maybe someone else can take it from here to get it working.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

It would be awesome to have a well defined way to define variants of image styles in core so contrib no longer needs to hack around this problem as is often the case. I think @heddn has the right idea, in that a single image style could generate multiple formats (or variants? Naming is hard) as opposed to the current limitation of a single image.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

@mrweiner I know it's contrib and I would love it to go into core, but I don't feel like that's a downside - a lot of really awesome and super useful things are implemented in contrib, prove their worth there, and are adopted into core. The biggest benefit in using Typed Entity (in my opinion) is that you now have a clean separation of your data (entities, their fields) and the logic that allows you to interact with it (the wrapped entity plug-ins), which leads to more testable code and hopefully away from spaghetti code.

@berdir That's also a good point that entities are serialized/deserialized a lot which adds even more potential headaches.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

I used to think DI on entities was a good idea and even implemented a way to do it via overriding the storage class, but I've honestly completely come around to the Typed Entity module approach of using a (very clever) way of wrapping entities; see #26 ( #2142515-26: Provide a method of DI for entities β†’ ). I over-engineered a solution to use DI on node entities, and it turned into a maintenance nightmare on multiple occasions, until I'd had enough and moved all that code to entity wrappers.

Here's the big problem with adding DI to entities: entities are already complex, and this just loads more complexity into them, making them more tedious to test, mock up, etc.

I know the thought of having to add an additional step every time you act on an entity to wrap it may seem annoying - and it certainly held me back for a while - but the benefits end up far outweighing that by allowing you to mock up and test parts of the logic without baking it directly into entity classes. If you want to see a concrete example (and one I'm very proud of), here's an absolutely massive merge request from last year where I did such a refactor to replace overloaded entity class logic with entity wrappers.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

@kopeboy: Yup, the PWA module β†’ provides a service worker sub-module. There are still a bunch of issues and things that can be improved, but it should work for basic offline stuff.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Updating the issue title and summary to reflect to the current state of the implementation. I've had a chance to work on the issue fork, and it seems it mostly works now if we detach behaviours on the turbo:before-cache event but there are still some remaining issues:

  1. turbo:before-cache is not currently able to be delayed until a page has transitioned out, so if a behaviour detaching causes visible changes to the page, these will be briely seen before a transition out has begun; there are potential solutions to this:
    1. TBD; coffee shop closing back later lolol
  2. The core Navigation is even more broken due to lacking detach callbacks for most of its JavaScript; this is fixable by adding detach callbacks, but will take some time and untangling of its spaghetti JavaScript; see 🌱 Turbo: Tracking issue of core and contrib behaviours that need fixes to correctly detach and then attach Active
πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Added failure states list item.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

I just wanted to jump in and say that comment #31 ( #3404409-31: [Plan] Gradually replace Drupal's AJAX system with HTMX β†’ ) is a phenomenal summary and argument for why Drupal should fully embrace the HTMX approach and not compromise on that philosophy. πŸ‘

I die a little on the inside every time someone throws their hands up and wants to reimplement Drupal's front- and/or back-end using a purely front-end JavaScript framework, demoting Drupal to just a fancy JSON endpoint. We don't need to throw out the Cache API, Twig templates, all the security and reliability of rendering on the server, to fix the admitted UX problems associated with vanilla server rendered navigation.

If it's page transitions and partial page updates you're after, use HTMX, Hotwire Turbo, or Unpoly. (See the RefreshLess module β†’ .) If it's that the server feels too slow, proper use of the Cache API can help a lot, but you can also implement a Service Worker to intercept and respond instantly while it sends requests to the server in the background. This is a solved engineering problem that works completely with server-rendered HTML.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Marking CSS specificity item partially complete.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

πŸ› Fix mismatch of $base_url with Symfony request object Needs work may be related to this, or at least an adjacent issue.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Yikes. Reminds of when the Hux module β†’ started out and discovered there were a few modules that were type hinting to the ModuleHandler class instead of ModuleHandlerInterface like they should have. I'm thinking we should expand the scope of this issue to fix any other instances in the module where we're type hinting to classes rather than interfaces. What do you all say?

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Finally had a chance to try this out and it seems to work well. Awesome work! Is it just ConfigSingleExportForm so far, or are there other forms or interactions that have been switched over?

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Updated summary to reflect that we now have core patching in CI.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Updated the status of a bunch of items and rewrote a few things to reflect current state of various fixes.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

I've created a new branch (3414538-what-if-attachments-processor) in the issue fork to try and implement a decorated attachments processor, but I can't yet get it to work. The main motivation here is to no longer rely on ajaxPageState because outputting it on every page results in certain generated URLs that have a query string (e.g. pager, admin/config compact toggle link, etc.) also including the Ajax page state in their URL, which in turn causes some weird behaviour with those links where Turbo doesn't kick in during history back/forward navigation, in addition to looking messy and ugly.

There's something I'm not understanding and not doing correctly with the library diffing, and without a clear indicator of what libraries are being added and when, it's hard to pin down. I think this would need some kind of debugging output when libraries are added to hopefully spot what's going wrong, but I'm tired and need to do other stuff right now.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

Marking as fixed as a result of patching Turbo.

πŸ‡¨πŸ‡¦Canada ambient.impact Toronto

πŸ€”πŸ€”πŸ€” πŸ› Logic error in Drupal's lazy load for asset aggregation Active will definitely be helpful for this. Will have to experiment with 10.4 when I get a chance.

I have mixed feelings about the stale file threshold: I can see it being useful for some smaller sites and it would be nice to have cache clears not wipe out aggregates, but on the other hand, I feel like it's treating a symptom and not the root cause; the root cause usually being that it's the tool someone reaches for when they don't know how to use update hooks, the Cache API (tag invalidation, etc.), or the appropriate service to clear/rebuild a specific thing they need. That's specifically why I created the Rebuilder module β†’ , which can rebuild just aggregated assets among several other things.

Production build 0.71.5 2024