Skip to content

Commit

Permalink
fix(vite): resolve PURE comment warnings (#5018)
Browse files Browse the repository at this point in the history
remove `/*@__PURE__*/` comment pragma warnings from vite v5/rollup v4
from a pragma that was applied to a variable assignment that rollup
can't understand.

prior to this fix, building a stencil/ionic project using stencil would
result in a warning in the console similar to the following:
```
vite v5.0.0-beta.14 building for production...
node_modules/.pnpm/@Stencil+core@4.7.0/node_modules/@stencil/core/internal/client/index.js (3800:17) A comment

"/*@__PURE__*/"

in "node_modules/.pnpm/@Stencil+core@4.7.0/node_modules/@stencil/core/internal/client/index.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.
```

Stencil-996 bug: vite v5 warning

fixes: #5008
  • Loading branch information
rwaskiewicz committed Nov 6, 2023
1 parent df4c101 commit 0a1fbe1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/client/client-task-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const flush = () => {
}
};

export const nextTick = /*@__PURE__*/ (cb: () => void) => promiseResolve().then(cb);
export const nextTick = (cb: () => void) => promiseResolve().then(cb);

export const readTask = /*@__PURE__*/ queueTask(queueDomReads, false);

Expand Down
2 changes: 1 addition & 1 deletion src/hydrate/platform/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const writeTask = (cb: Function) => {
};

const resolved = /*@__PURE__*/ Promise.resolve();
export const nextTick = /*@__PURE__*/ (cb: () => void) => resolved.then(cb);
export const nextTick = (cb: () => void) => resolved.then(cb);

const defaultConsoleError = (e: any) => {
if (e != null) {
Expand Down

0 comments on commit 0a1fbe1

Please sign in to comment.