-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Defer throwing asset errors until after dependencies are handled. #2475
Merged
DeMoorJasper
merged 9 commits into
parcel-bundler:master
from
MattCheely:improve-dep-error-handling
Jan 3, 2019
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c36d1a7
Defer throwing asset errors until after dependencies are handled.
MattCheely e7ba284
Fix Elm error generation.
MattCheely 1315f35
Add test for tracking dependencies on error
MattCheely 83335d1
revert hmr-runtime changes
MattCheely 077f20e
Transform all errors in Pipeline.process.
MattCheely a6b9358
Separate error-depenency test input from basic Elm tests.
MattCheely e1f027f
Update ElmAsset.js
DeMoorJasper 0a2943a
Merge branch 'master' into improve-dep-error-handling
DeMoorJasper c808a4d
Merge branch 'master' into improve-dep-error-handling
DeMoorJasper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
8 changes: 8 additions & 0 deletions
8
packages/core/integration-tests/test/integration/elm/src/BrokenDep.elm
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module BrokenDep exposing (anError) | ||
|
||
{- This module causes a compiler error -} | ||
|
||
|
||
anError : String | ||
anError = | ||
2 |
48 changes: 48 additions & 0 deletions
48
packages/core/integration-tests/test/integration/elm/src/MainWithBrokenDep.elm
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
module Main exposing (main) | ||
|
||
import BrokenDep | ||
import Browser | ||
import Html exposing (Html, button, div, text) | ||
import Html.Events exposing (onClick) | ||
|
||
|
||
type alias Model = | ||
{ count : Int } | ||
|
||
|
||
initialModel : Model | ||
initialModel = | ||
{ count = 0 } | ||
|
||
|
||
type Msg | ||
= Increment | ||
| Decrement | ||
|
||
|
||
update : Msg -> Model -> Model | ||
update msg model = | ||
case msg of | ||
Increment -> | ||
{ model | count = model.count + 1 } | ||
|
||
Decrement -> | ||
{ model | count = model.count - 1 } | ||
|
||
|
||
view : Model -> Html Msg | ||
view model = | ||
div [] | ||
[ button [ onClick Increment ] [ text "+1" ] | ||
, div [] [ text <| String.fromInt model.count ] | ||
, button [ onClick Decrement ] [ text "-1" ] | ||
] | ||
|
||
|
||
main : Program () Model Msg | ||
main = | ||
Browser.sandbox | ||
{ init = initialModel | ||
, view = view | ||
, update = update | ||
} |
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 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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes an issue for Elm, but I probably also need to do something like this in
Pipeline.js
for other asset types that throwError
s. I'm not certain why this is necessary, but I suspect that there's an object copy somewhere inWorkerFarm
that causes data to be lost ifPipeline.process
returns an obejct containing anError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixed.