Skip to content

fix: resolve .jsx, .ts and .tsx block sources - #5

Open
thierrypigot wants to merge 1 commit into
pluginslab:mainfrom
thierrypigot:fix/resolve-jsx-block-sources
Open

thierrypigot wants to merge 1 commit into
pluginslab:mainfrom
thierrypigot:fix/resolve-jsx-block-sources

Conversation

@thierrypigot

Copy link
Copy Markdown

The save, edit and variations parsers, and the block directory hash, only looked for save.js, edit.js and variations.js. Gutenberg renamed its JSX-bearing block sources to .jsx in WordPress/gutenberg#80990, so indexing Gutenberg trunk classified every core block as dynamic, with no verified example and no inspector control.

Add resolveSourceFile(), which tries .js, .jsx, .ts then .tsx, and use it in the three parsers and in computeBlockDirHash(). Hashes of blocks that only ship .js files are unchanged, so existing indexes are not rebuilt.

The save, edit and variations parsers, and the block directory hash,
only looked for save.js, edit.js and variations.js. Gutenberg renamed
its JSX-bearing block sources to .jsx in WordPress/gutenberg#80990, so
indexing Gutenberg trunk classified every core block as dynamic, with
no verified example and no inspector control.

Add resolveSourceFile(), which tries .js, .jsx, .ts then .tsx, and use
it in the three parsers and in computeBlockDirHash(). Hashes of blocks
that only ship .js files are unchanged, so existing indexes are not
rebuilt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants