Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Tracking issue: WordPress Directives Plugin 🎨 #80

Closed

Description

@luisherranz

This issue aims to list and keep track of the tasks related to the WordPress Directives Plugin experiment. The goal is to create an installable plugin that adds a set of basic directives and client-side navigations to any site.

For this experiment's stress-testing, please check the Tracking Issue: Performance and stress-testing vDOM Hydration 🧪

For the Custom Elements or Directives Hydration experiment, please check their corresponding Tracking Issues.

The main branch of this experiment is main-wp-directives-plugin. Make sure you select it when opening a pull request if it is related to this experiment.

Please proactively comment on this issue whenever you start working on a new task, get blocked, or finish a task, sharing as much detail and information as possible. Thanks!!

High-level overview

  • Directives

    • Finish the directives of the initial list - In progress 🚧

      Work on the directives is still reactive as we only work on the ones that we need for our experiments, demos, etc. The work on the Movies demo and Woo blocks should bring some focus to this task.

    • Add SSR for the ones that need it - In progress 🚧\

      This is led by @ockham and @dmsnell.

      There's already initial support for the SSR of basic directive attributes and good progress on wp-context. The next challenge to solve is to figure out the APIs to access the inner HTML with the HTML (Tag) Processor.

    • Decide final names - In progress 🚧

      We are keeping a list of the decisions that need to be made here in the Tracking Issue.

  • Components

    There hasn't been any progress on this, mostly due to the lack of need for components (directive tags). @luisherranz opened an issue proposing their removal, as we couldn't find a single case where they add meaningful value and we might want to use them for other purposes in the future.

  • State Management

    • Finish the Deep Signals implementation - Finished ✅
    • Decide on the recommended shape - In progress 🚧
      Same answer as in the "Directives - Decide final names".
    • TypeScript support - Not started ⏸
    • Figure out if we want to expose some parts of the router and/or other configuration in the state (example) - Not started ⏸
  • Server-side rendering

    • API to do SSRing - In progress 🚧
      Same answer as in the "Directives - Add SSR for the ones that need it".
    • Serialize initial state - Finished ✅
    • Sort directives by priority - Not started ⏸
  • Client runtime

    • Limit hydration when CSN is not possible Finished ✅
    • Deserialize state Finished ✅ (mostly)
    • Sort directives by priority - In progress 🚧
  • Bundling

    • API to register directives/components - Not started ⏸
    • Enqueue directives/components present in the HTML - Not started ⏸
    • Ensure script execution order, deferring and prefetch - Not started ⏸
    • Choose final package name and shape - In progress 🚧
      Same answer as in the "Directives - Decide final names".
    • Choose and implement dependency management - In progress 🚧
      Barely started, just preliminary conversations between @luisherranz, @gziolo, @dmsnell and @youknowriad.
  • Client-side navigation

    • Manual (Finished ✅) and automatic opt-in (Not started ⏸)
    • Router
      • Fetch directives/components scripts - Not started ⏸
      • Global state (state.router.url) - Not started ⏸
    • API to trigger virtual pageviews - Not started ⏸
    • Prefetching strategy - Not started ⏸

Done

In progress

Next

Decisions that need to be made

Experiments

Activity

  1. pinned this issue on Oct 14, 2022
  2. luisherranz commented on Oct 14, 2022

    @luisherranz
    MemberAuthor

    I've opened the main-wp-directives-plugin branch with a basic skeleton of a plugin, including a basic webpack configuration and enqueuing of the runtime/vendor scripts.

  3. luisherranz commented on Oct 14, 2022

    @luisherranz
    MemberAuthor

    I've added some basic tasks to the OP to get the client-side navigations working, which is our first task.

    These two experiments contain much of the required code:

    We should rename wp-client-transition to wp-link.

  4. SantosGuillamot commented on Oct 17, 2022

    @SantosGuillamot
    Contributor

    I have created a Pull Request to "Add the wp-link to all the relative links on the page". It is still a draft, but I opened it to keep the discussion about that specific task there.

  5. luisherranz commented on Oct 17, 2022

    @luisherranz
    MemberAuthor

    I've created a pull request to add the basic vdom + directives functionality.

    I'll now create another one for the router + wp-link.

  6. luisherranz commented on Oct 17, 2022

    @luisherranz
    MemberAuthor

    I've created the pull request to add the router and the wp-link directive.

  7. luisherranz commented on Oct 17, 2022

    @luisherranz
    MemberAuthor

    I've created another pull request to change the toVdom logic to test removing the comment nodes and preserving the script's children:

  8. DAreRodz commented on Oct 18, 2022

    @DAreRodz
    Collaborator

    I'll be working on adding page transitions to the client-side navigations using the Shared Element Transition API. I'll share here a link to the PR soon.

  9. luisherranz commented on Oct 19, 2022

    @luisherranz
    MemberAuthor

    I've created a PR to add support for CSS loading during client-side navigations:

  10. luisherranz commented on Oct 19, 2022

    @luisherranz
    MemberAuthor

    I've opened a PR to add a basic opt-in mechanism based on a custom meta tag:

  11. SantosGuillamot commented on Oct 19, 2022

    @SantosGuillamot
    Contributor

    I've opened a PR to add prefetch to all links and prevent scrolling in the pagination:

    While doing that, we realized that the HTML of the parent blocks contains the children, so we were parsing the HTML multiple times. For that, we change the filters to only trigger for the Query Loop and the Template Parts until we figure out a better solution.

  12. luisherranz commented on Oct 19, 2022

    @luisherranz
    MemberAuthor

    Another PR to add an admin page with a checkbox to toggle client-side navigations (for testing purposes only):

  13. luisherranz commented on Oct 21, 2022

    @luisherranz
    MemberAuthor

    I did a couple of bug fixes that we noticed while working on this demo:

  14. luisherranz commented on Oct 26, 2022

    @luisherranz
    MemberAuthor

    I've opened an issue to talk about limiting the hydration surface when the site doesn't support client-side navigations:

  15. 29 remaining items

  16. luisherranz commented on Mar 13, 2023

    @luisherranz
    MemberAuthor

    I've opened a couple of issues, one to make the hydration more resilient (and make it work with template) and the other to see how we could integrate the new View Transitions API:

  17. luisherranz commented on Mar 23, 2023

    @luisherranz
    MemberAuthor

    It's very preliminary yet, but @DAreRodz and I have started an experiment to do client-side form submissions on the Comments Form block:

  18. luisherranz commented on Mar 23, 2023

    @luisherranz
    MemberAuthor

    Added this to the list, mentioned by @tomjn here:

  19. luisherranz commented on Mar 27, 2023

    @luisherranz
    MemberAuthor
  20. michalczaplinski commented on Mar 27, 2023

    @michalczaplinski
    Collaborator

    I've reopened

    because it became clear that wp_store is not the right final name. It would be amazing if we could decide before publishing the blog post introducing the Interactivity API because having a bad name is easy for people to nitpick.

    Realistically, we might need more time, though 🙂

  21. luisherranz commented on Mar 28, 2023

    @luisherranz
    MemberAuthor

    We finished the basic functionality of the Comments Form submission experiment:

  22. luisherranz commented on Apr 12, 2023

    @luisherranz
    MemberAuthor

    @artemiomorales started this experiment of a lightbox for images, similar to the one in Medium:

  23. luisherranz commented on Apr 14, 2023

    @luisherranz
    MemberAuthor

    I've added support for the ! operator: "!state.boolean"

    I've also improved the logic of data-wp-bind and added some e2e tests.

  24. luisherranz commented on Apr 20, 2023

    @luisherranz
    MemberAuthor

    I finally merged the createTreeWalker version:

    @DAreRodz and I have also started working on a branch to simplify the runtime so we can start testing it with core blocks:

  25. DAreRodz commented on May 8, 2023

    @DAreRodz
    Collaborator

    I haven't opened a PR yet, but I just started working on sorting directives by priority. I'll update this comment with the PR link soon.

  26. luisherranz commented on May 15, 2023

    @luisherranz
    MemberAuthor
  27. unpinned this issue on Jul 27, 2023
  28. luisherranz commented on Jul 28, 2023

    @luisherranz
    MemberAuthor

    I'm going to close this issue as part of the migration to the Gutenberg repository.

    This is the current Tracking Issue on Gutenberg. Please refer to it from now on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions