Skip to content
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

feat(runtime-vapor): provide and inject #158

Merged
merged 8 commits into from
Mar 22, 2024
Merged

Conversation

ubugeeei
Copy link
Member

@ubugeeei ubugeeei commented Mar 20, 2024

related: #4

Implemented provide/inject!
Almost all tests in runtime-core passed (except for the Options API).

Uncertainties:

  • What to do with currentRenderingInstance
  • Is it okay to pass the parent as an argument? ✅

@ubugeeei ubugeeei marked this pull request as draft March 20, 2024 15:11
Copy link

netlify bot commented Mar 20, 2024

Deploy Preview for vapor-template-explorer ready!

Name Link
🔨 Latest commit facfbb9
🔍 Latest deploy log https://app.netlify.com/sites/vapor-template-explorer/deploys/65fda6288009b8000898ffe1
😎 Deploy Preview https://deploy-preview-158--vapor-template-explorer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 20, 2024

Deploy Preview for vapor-repl ready!

Name Link
🔨 Latest commit facfbb9
🔍 Latest deploy log https://app.netlify.com/sites/vapor-repl/deploys/65fda628437ee5000880924e
😎 Deploy Preview https://deploy-preview-158--vapor-repl.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ubugeeei ubugeeei mentioned this pull request Mar 20, 2024
28 tasks
Copy link

github-actions bot commented Mar 20, 2024

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 80 kB 28.1 kB 24.7 kB
compiler-vapor.global.prod.js 48.9 kB 16.7 kB 15.1 kB
runtime-dom.global.prod.js 94.5 kB 35.6 kB 32 kB
runtime-vapor.global.prod.js 41.3 kB (+737 B) 15.4 kB (+268 B) 14.1 kB (+234 B)
vue-vapor.global.prod.js 87.7 kB (+737 B) 30.6 kB (+247 B) 27.7 kB (+234 B)
vue.global.prod.js 152 kB 54.9 kB 49 kB

Usages

Name Size Gzip Brotli
createApp 54.8 kB 21 kB 19.2 kB
createSSRApp 58.1 kB 22.3 kB 20.4 kB
defineCustomElement 57.1 kB 21.8 kB 19.9 kB
vapor 41.5 kB (+731 B) 15.4 kB (+260 B) 14.1 kB (+217 B)
overall 68.5 kB 26.1 kB 23.6 kB

@ubugeeei
Copy link
Member Author

Passing the parent instance as an argument or getting it within createComponentInstance using getCurrentInstance is a dilemma. The former seems better, but it might be a bit redundant.

@ubugeeei ubugeeei marked this pull request as ready for review March 20, 2024 16:37
@ubugeeei ubugeeei requested a review from sxzz March 20, 2024 16:37
@sxzz
Copy link
Member

sxzz commented Mar 20, 2024

Why do we have to pass parent as an argument? I think currentInstance is enough.

playground/src/props.js Outdated Show resolved Hide resolved
@ubugeeei
Copy link
Member Author

ubugeeei commented Mar 21, 2024

I've updated createComponentInstance to call getCurrentInstance!

The reason I thought passing arguments might be better is because it seemed somewhat implicit, and the original implementation (renderer.ts) handled it with the parentComponent argument.
So I thought it might be better to align with that.
I fundamentally don't grasp why it's like that...

@ubugeeei ubugeeei force-pushed the ubugeeei/feat/provide-inject branch 2 times, most recently from 945bd53 to 31e19df Compare March 21, 2024 00:32
@sxzz sxzz force-pushed the ubugeeei/feat/provide-inject branch from 31e19df to 339e674 Compare March 22, 2024 15:36
@sxzz sxzz merged commit 5c9a151 into main Mar 22, 2024
11 checks passed
@sxzz sxzz deleted the ubugeeei/feat/provide-inject branch March 22, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants