Skip to content

WIP: Packages: Add the code editor package#8252

Closed
youknowriad wants to merge 1 commit intomasterfrom
try/add-code-editor-package
Closed

WIP: Packages: Add the code editor package#8252
youknowriad wants to merge 1 commit intomasterfrom
try/add-code-editor-package

Conversation

@youknowriad
Copy link
Copy Markdown
Contributor

This PR adds the code editor package as a Gutenberg package. The code was copied as is from Core and tweaked a little bit:

  • Removing the use of globals
  • Lodash instead of undersscore

This PR is not working yet because in the CodeEditor component, we try to do async loading of scripts and styles and for some reason the load-scripts.php is not returning the wp-code-editor script and style (registered in Gutenberg), it only works for Core registered scripts/styles (I'll need a help from a WordPress Core expert here).

@youknowriad youknowriad added the npm Packages Related to npm packages label Jul 27, 2018
@youknowriad youknowriad self-assigned this Jul 27, 2018
@youknowriad youknowriad requested a review from a team July 27, 2018 12:00
@aduth
Copy link
Copy Markdown
Member

aduth commented Aug 30, 2018

Related: #8017

"@wordpress/components": "file:packages/components",
"@wordpress/compose": "file:packages/compose",
"@wordpress/core-data": "file:packages/core-data",
"@wordpress/core-editor": "file:packages/code-editor",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this line intentional? core-editor , not code-editor ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

definitely not :)

@@ -0,0 +1,13 @@
# Blob
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copypasta. 🍝

Install the module

```bash
npm install @wordpress/code-editor --save
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

--save is not necessary (it's now default).

let currentErrorAnnotations = [],
previouslyShownErrorAnnotations = [];

/**
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tabbing alignment (various related issues with most functions in this file).

Copy link
Copy Markdown
Contributor Author

@youknowriad youknowriad Aug 30, 2018

Choose a reason for hiding this comment

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

You know, old style WP scripts 🤷‍♂️ I did some tweaks, but there's more we can do here :)

@youknowriad youknowriad added the [Status] Blocked Used to indicate that a current effort isn't able to move forward label Sep 7, 2018
@youknowriad
Copy link
Copy Markdown
Contributor Author

Blocked by a reliable lazy-loading approach

@aduth
Copy link
Copy Markdown
Member

aduth commented Oct 30, 2018

Do we need this anymore?

@youknowriad
Copy link
Copy Markdown
Contributor Author

Not anymore. We may want something like that later but fine to close now.

@youknowriad youknowriad deleted the try/add-code-editor-package branch October 30, 2018 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

npm Packages Related to npm packages [Status] Blocked Used to indicate that a current effort isn't able to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants