Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle callback correctly in the readRecords compiler hook #16944

Merged
merged 2 commits into from Apr 12, 2023

test: add a case for readRecords hook usage

d011d86
Select commit
Failed to load commit list.
Merged

fix: handle callback correctly in the readRecords compiler hook #16944

test: add a case for readRecords hook usage
d011d86
Select commit
Failed to load commit list.
Deleted GitHub App / Copilot for PRs succeeded Apr 8, 2023 in 29s

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 imports async.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 go
  • copilot:summary: a one paragraph summary of the code changes
  • copilot:walkthrough: a step by step walkthrough of the code changes
  • copilot: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

Progress:

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