fix: handle callback correctly in the readRecords
compiler hook
#16944
Analysis complete
Summary
This pull request fixes a bug that caused the compiler to hang when using the readRecords
hook, and adds a new test case to verify the chunk splitting and naming based on the records. The test case uses a new plugin and a mock records file to simulate the readRecords
hook functionality.
Walkthrough
-
Fix a bug that caused the compiler to hang when using the
readRecords
hook (link) -
Add a new plugin class
ReadRecordsPlugin
that simulates some asynchronous work before reading the records (link) -
Add a new test case in
index.js
that dynamically importsasync.js
and expects it to load fine (link) -
Add a new module
async.js
that imports a vendor module for testing the chunk splitting and naming based on the records (link) -
Add a new file
records.json
that contains some mock records for the chunks (link) -
Add a new webpack configuration file that sets the entry point, the records input path, the output chunk filename, the
ReadRecordsPlugin
and the split chunks optimization (link)Poem
readRecords
hook
fixed a bug with callback
now tests run fine
Emoji
🐛🧪🔌
Include these descriptions in your pull request description by including the following marker tags:
copilot:all
: all the content, in one gocopilot:summary
: a one paragraph summary of the code changescopilot:walkthrough
: a step by step walkthrough of the code changescopilot:poem
: a poem about the code changes!copilot:emoji
: three emoji that capture the changes
Feedback is welcome. Simply add a comment to this PR of the form /copilot feedback [your comments here]
.
Details
Copilot for PRs is a limited technical preview from GitHub Next.
It's aim is to make it easier to write pull request descriptions by providing automatically generated suggestions based on the code changes.
To find out more go to https://githubnext.com/projects/copilot-for-pull-requests or come and chat with us on Discord
File | Status | Duration |
---|---|---|
Summary & Walkthrough | ✅ Finished | 26.8 seconds |
lib/Compiler.js | ✅ Finished | 16.5 seconds |
test/configCases/records/with-readRecords-hook/ReadRecordsPlugin.js | ✅ Finished | 16.5 seconds |
test/configCases/records/with-readRecords-hook/async.js | ✅ Finished | 16.5 seconds |
test/configCases/records/with-readRecords-hook/index.js | ✅ Finished | 16.5 seconds |
test/configCases/records/with-readRecords-hook/records.json | ✅ Finished | 16.5 seconds |
test/configCases/records/with-readRecords-hook/webpack.config.js | ✅ Finished | 16.5 seconds |