Add TypeScript support for blocks
Although we added TypeScript support in monorepo in #23522, but it seems like blocks are built using separate webpack config.
Related #16375
Changes proposed in this Pull Request:
- Update webpack config for extensions/blocks to allow usage of TypeScript
- Create
utilsmodule injs-packages/webpack-configto use for webpack specific utility functions
Jetpack product discussion
#16375
Does this pull request change what data or activity we track or use?
No
Testing instructions:
- Boot up the PR
- Run
jetpack build plugins/jetpack - Confirm that all the blocks are built successfully
Thank you for your PR!
When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
- :white_check_mark: Include a description of your PR changes.
- :white_check_mark: All commits were linted before commit.
- :white_check_mark: Add a "[Status]" label (In Progress, Needs Team Review, ...).
- :white_check_mark: Add testing instructions.
- :white_check_mark: Specify whether this PR includes any changes to data or privacy.
- :white_check_mark: Add changelog entries to affected projects
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation :robot:
The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.
Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Then, add the "[Status] Needs Team review" label and ask someone from your team review the code. Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.
Jetpack plugin:
- Next scheduled release: May 3, 2022.
- Scheduled code freeze: April 25, 2022.
- On one hand, it doesn't hurt to add support now, this way we'll be ready for TypeScript later.
Yeah, that's what I think. It doesn't add any TypeScript, yet. Since we have all the other areas ready for TypeScript, it doesn't hurt to prepare blocks for the same. We can start using TS in blocks whenever we want.
We can start using TS in blocks whenever we want.
I'd rather we didn't, to be clear. I would suggest we hold off using TS in blocks until we decide that we should use TS, and only TS. This would make for a more consistent experience for both contributors and reviewers. Having different people doing different things will be messy for everyone involved.
I'd rather we didn't, to be clear. I would suggest we hold off using TS in blocks until we decide that we should use TS, and only TS. This would make for a more consistent experience for both contributors and reviewers. Having different people doing different things will be messy for everyone involved.
Alright, sounds like a good plan. Thanks.