This repository was archived by the owner on Apr 6, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 995
fix(nuxt): use parser to treeshake <ClientOnly>
#8713
Merged
danielroe
merged 39 commits into
nuxt:main
from
huang-julien:fix/treeshakeCLientOnlyStyle
Feb 8, 2023
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
ec8967b
fix(nuxt): use parser for treeshake module
huang-julien a62d688
test(nuxt): ensure scoped style does not break
huang-julien ee02bed
style: lint
huang-julien 27c9205
refactor(nuxt): improve regex and change jsdoc
huang-julien fecea00
fix(nuxt): treeshake client only components in setup
huang-julien 6357b28
fix(nuxt): fix refactor + change component to components
huang-julien d8397c1
chore: remove `ultrahtml` dependency
danielroe 13aa7f8
Update packages/nuxt/src/components/tree-shake.ts
huang-julien 3bb188b
Update packages/nuxt/src/components/tree-shake.ts
huang-julien 34107a2
refactor(nuxt): use escapeStringRegexp()
huang-julien 3cb007a
fix(nuxt): set back treeshake for all clientonly components
huang-julien 4ec2fa9
fix(nuxt): avoid removing placeholder slot
huang-julien 334d68f
fix(nuxt): fix regexpMap
huang-julien 210da41
test(nuxt): ensure .client components are treeshaken
huang-julien 9dd27d5
style: lint
huang-julien 24f85fe
fix(nuxt): add new regex to match component exact var name using ^$
huang-julien ddc0e70
fix: treeshake direct import of .client components
huang-julien ac4cdb2
fix: treeshake lazy client
huang-julien f27f94d
fix(nuxt): treeshake all slots on .client components
huang-julien 9ee2e49
Apply suggestions from code review
huang-julien 1a86be5
fix(nuxt): treeshake call expressions with ssrRenderComponent
huang-julien 8923aec
Merge branch 'fix/treeshakeCLientOnlyStyle' of https://github.com/huaβ¦
huang-julien 3ac6cd1
Merge branch 'main' into fix/treeshakeCLientOnlyStyle
huang-julien cac7cc2
chore: fix lock
huang-julien 121e1f3
Merge branch 'main' into fix/treeshakeCLientOnlyStyle
danielroe 205293e
Merge remote-tracking branch 'origin/main' into fix/treeshakeCLientOnβ¦
danielroe b08125f
test(nuxt): unit test treeshake client plugin
huang-julien 0fe07f6
fix(nuxt): remove whole line of component declaration instead of remoβ¦
huang-julien 521f883
refactor(nuxt): move some logic into a function
huang-julien c40c649
chore: remove unecessary comment
huang-julien 646e69f
test(nuxt): add snapshots for treeshake client only
huang-julien 939bc3d
test: fix snapshot
huang-julien 139c615
fix: update snapshot
huang-julien 392b401
test: directly mock node:crypto
huang-julien eabbff9
Merge remote-tracking branch 'origin/main' into fix/treeshakeCLientOnβ¦
danielroe 73da1fe
test(nuxt): mock path relative due to os differences
huang-julien cbfe602
test: set correct mock
huang-julien 7fc8681
test: fix max callstack
huang-julien e5271a7
lint + fix
huang-julien 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 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
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
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
Binary file not shown.
38 changes: 38 additions & 0 deletions
38
packages/nuxt/test/fixture/components/client/WithClientOnlySetup.vue
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| <template> | ||
| <div> | ||
| <div> | ||
| <Glob /> | ||
| </div> | ||
| {{ hello }} | ||
| <div class="not-client"> | ||
| Hello | ||
| </div> | ||
| <ClientOnly> | ||
| <HelloWorld /> | ||
| <Glob /> | ||
| <SomeGlob /> | ||
| </ClientOnly> | ||
| <ClientOnly> | ||
| <div class="should-be-treeshaken"> | ||
| this should not be visible | ||
| </div> | ||
| <ClientImport /> | ||
| <Treeshaken /> | ||
| <ResolvedImport /> | ||
| </ClientOnly> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { Treeshaken } from 'somepath' | ||
| import HelloWorld from '../HelloWorld.vue' | ||
| import { Glob, ClientImport } from '#components' | ||
|
|
||
| const hello = 'world' | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .not-client { | ||
| color: "red"; | ||
| } | ||
| </style> |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.