Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

refactor(nuxt): do not add all composable auto-imports to globalThis - #9630

Merged
danielroe merged 3 commits into
mainfrom
perf/inject-globals
Dec 13, 2022
Merged

refactor(nuxt): do not add all composable auto-imports to globalThis#9630
danielroe merged 3 commits into
mainfrom
perf/inject-globals

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

globals is turned off by default, and I think we can keep the same behaviour as without it. Otherwise there's extra work done on initial build/warmup for all composables and I'm not sure of the benefit. (I think it is a hold-over from previous default behaviour.)

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroedanielroe added bug Something isn't working chore 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing labels Dec 9, 2022
@danielroe
danielroe requested review from antfu and pi0December 9, 2022 15:59
@danielroedanielroe self-assigned this Dec 9, 2022
@codesandbox

Copy link
Copy Markdown

CodeSandbox logoCodeSandbox logo Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@danielroedanielroe changed the title perf(nuxt): do not add all composable auto-imports to globalThisperf(nuxt): do not add all composable auto-imports to globalThisDec 9, 2022
@pi0

pi0 commented Dec 12, 2022

Copy link
Copy Markdown
Member

global option was actually added to remove the parsing overhead (to detect usage in dev) but i think transform overhead of loading composable files should be more at least in a small sized project (we never benchmarked AFAIK)

Removing this option makes sense 👍🏼 Only i think we can consider this PR a refactor since is not changing any behavior?

@danielroedanielroe changed the title perf(nuxt): do not add all composable auto-imports to globalThisrefactor(nuxt): do not add all composable auto-imports to globalThisDec 13, 2022
@danielroe
danielroe merged commit 0cb9a4c into mainDec 13, 2022
@danielroe
danielroe deleted the perf/inject-globals branch December 13, 2022 10:30
@pi0pi0 mentioned this pull request Dec 15, 2022
6 tasks
@danielroedanielroe mentioned this pull request Jan 20, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xbugSomething isn't workingchore🍰 p2-nice-to-havePriority 2: nothing is broken but it's worth addressing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@danielroe@pi0@antfu