-
-
Notifications
You must be signed in to change notification settings - Fork 623
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
refactor: miette::Error
as Diagnostic
and rspack_error::Error
#4892
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Dec 5, 2023
Current dependencies on/for this PR: This stack of pull requests is managed by Graphite. |
github-actions
bot
added
the
team
The issue/pr is created by the member of Rspack.
label
Dec 5, 2023
h-a-n-a
force-pushed
the
12-04-refactor_io_errors
branch
from
December 5, 2023 05:07
3406e7f
to
371fc68
Compare
h-a-n-a
force-pushed
the
12-04-refactor_error_and_diagnostics
branch
from
December 5, 2023 05:12
4c359da
to
35be7b3
Compare
h-a-n-a
force-pushed
the
12-04-refactor_io_errors
branch
3 times, most recently
from
December 5, 2023 07:33
61772dc
to
e6d3be0
Compare
h-a-n-a
force-pushed
the
12-04-refactor_error_and_diagnostics
branch
from
December 5, 2023 07:58
35be7b3
to
2247eee
Compare
h-a-n-a
force-pushed
the
12-04-refactor_io_errors
branch
4 times, most recently
from
December 5, 2023 13:14
f9ad11f
to
d8388ff
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
h-a-n-a
force-pushed
the
12-04-refactor_io_errors
branch
4 times, most recently
from
December 6, 2023 08:07
ad87ad0
to
0143b8b
Compare
h-a-n-a
force-pushed
the
12-04-refactor_io_errors
branch
4 times, most recently
from
December 7, 2023 10:21
c046417
to
0894cfe
Compare
h-a-n-a
force-pushed
the
12-04-refactor_error_and_diagnostics
branch
from
December 7, 2023 10:57
2247eee
to
b6ff92e
Compare
h-a-n-a
force-pushed
the
12-04-refactor_io_errors
branch
2 times, most recently
from
December 7, 2023 13:58
618339d
to
c867026
Compare
h-a-n-a
requested review from
jerrykingxyz,
IWANABETHATGUY and
ScriptedAlchemy
December 8, 2023 04:39
...pack_error/tests/out_of_order/multi_json_syntax_error/fixtures__multi_json_syntax_error.snap
Show resolved
Hide resolved
IWANABETHATGUY
previously approved these changes
Dec 8, 2023
ahabhgk
previously approved these changes
Dec 8, 2023
h-a-n-a
dismissed stale reviews from ahabhgk and IWANABETHATGUY
December 8, 2023 06:06
The base branch was changed.
h-a-n-a
force-pushed
the
12-04-refactor_io_errors
branch
from
December 8, 2023 06:08
7109327
to
c55a30c
Compare
ahabhgk
approved these changes
Dec 8, 2023
This was referenced Dec 18, 2023
ahabhgk
pushed a commit
that referenced
this pull request
Jan 2, 2024
…4892) <!-- Thank you for submitting a pull request! We appreciate the time and effort you have invested in making these changes. Please ensure that you provide enough information to allow others to review your pull request. Upon submission, your pull request will be automatically assigned with reviewers. If you want to learn more about contributing to this project, please visit: https://github.com/web-infra-dev/rspack/blob/main/CONTRIBUTING.md. --> ## Summary Based on the overall idea behind this in #4866. This PR leverages `miette` and `thiserror` for representing errors and diagnostics. This makes aligning with webpack errors easily. 1. `miette::Error` as `rspack_error::Error` 2. `miette::Error` as `Diagnostic` 3. `Result<T> = std::result::Result<T, miette::Error>` 4. Print diagnostics with `miette::GraphicalReportHandler` 5. Eagerly deduped ecma errors on site, and remove `PartialEq`, etc from `Diagnostics`. 6. Refactored one Webpack Error to diagnostic representation, use https://github.com/web-infra-dev/rspack/pull/4892/files#diff-b6b8b1bb36b909de2bbe46c5de8c4c34515cb1c9710e8d02faec369b352da525R167 as an example Minor changes: 1. Removed `clippy::unwrap_in_result` as previously discussed. <!-- Can you explain the reasoning behind implementing this change? What problem or issue does this pull request resolve? --> <!-- It would be helpful if you could provide any relevant context, such as GitHub issues or related discussions. --> ## Test Plan See snapshot changes. <!-- Can you please describe how you tested the changes you made to the code? --> ## Require Documentation? <!-- Does this PR require documentation? --> - [X] No - [ ] Yes, the corresponding rspack-website PR is \_\_
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Based on the overall idea behind this in #4866.
This PR leverages
miette
andthiserror
for representing errors and diagnostics.This makes aligning with webpack errors easily.
miette::Error
asrspack_error::Error
miette::Error
asDiagnostic
Result<T> = std::result::Result<T, miette::Error>
miette::GraphicalReportHandler
PartialEq
, etc fromDiagnostics
.Minor changes:
clippy::unwrap_in_result
as previously discussed.Test Plan
See snapshot changes.
Require Documentation?