Repository navigation
Conversation
…onfiguration files In an application with SSR enabled, `ng g web-worker app` appends the worker creation snippet to `app.config.server.ts` instead of the component file. The sibling file exclusion pattern is end-anchored, so `app.config.server.ts` and `app.routes.server.ts` end in `server.ts` rather than `config.ts`/`routes.ts` and are not excluded, and the alphabetical sort places `app.config.server.ts` before `app.ts`. Exclude `.server.ts` variants and require a dot-separated type suffix so that component files such as `observer.ts` remain eligible. A new spec with a server application fails without this change.
There was a problem hiding this comment.
Code Review
This pull request updates the Angular web-worker schematic to prevent adding web worker snippets to server configuration files (such as app.config.server.ts) by refining the sibling file filtering regex. It also adds corresponding unit tests to verify this behavior. The review feedback suggests further refining the file filtering regex to exclude declaration files (.d.ts) and fixing a potential matching issue in fileRegExp due to a missing end anchor. Additionally, it is recommended to avoid reassigning the suite-level appTree variable in tests to prevent state leakage.
…erver configuration files
This file contains hidden or 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
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.
In an application with SSR enabled,
ng g web-worker appappends the worker creation snippet toapp.config.server.tsinstead of the component file. The sibling file exclusion pattern is end-anchored, soapp.config.server.tsandapp.routes.server.tsend inserver.tsrather thanconfig.ts/routes.tsand are not excluded, and the alphabetical sort placesapp.config.server.tsbeforeapp.ts. Exclude.server.tsvariants and require a dot-separated type suffix so that component files such asobserver.tsremain eligible. A new spec with a server application fails without this change.