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

Rename sufix character and island directive #239

Conversation

luisherranz
Copy link
Member

What

  1. I've renamed the directive syntax from data-wp-on.click to data-wp-on--click.

  2. I've renamed the data-wp-island directive to data-wp-interactive.

Why

  1. Because JSX doesn't support attributes with dots in them.
  2. Because the term island has no meaning in WordPress, and we don't intend to embrace it.

How

  1. I just renamed everything, including the regular expression.

    I also added an explanation of the expression and made sure that it remains valid HTML by disallowing anything other than alphanumeric characters and hyphens. I purposely disallowed underscores to prevent confusion with hyphens.

    I also renamed the prefix constant to hardcode data- and ensure that it always generates valid HTML.

  2. I just renamed data-wp-island to data-wp-interactive.

@luisherranz luisherranz self-assigned this May 31, 2023
@luisherranz luisherranz marked this pull request as ready for review May 31, 2023 15:39
Copy link
Contributor

@SantosGuillamot SantosGuillamot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested it, and it seems to be working fine 👌 Thanks for taking care of it!

Just a minor detail: should we change the comments in the directives definition (link)?

@luisherranz
Copy link
Member Author

should we change the comments in the directives definition (link)?

Oh, true. I'll do that, thanks 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename data-wp-island to data-wp-interactive Should we follow the HTML specification to the letter?
2 participants