-
-
Notifications
You must be signed in to change notification settings - Fork 861
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
VueI18n factory #592
base: dev
Are you sure you want to change the base?
VueI18n factory #592
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #592 +/- ##
==========================================
- Coverage 96.18% 96.12% -0.07%
==========================================
Files 10 10
Lines 786 799 +13
==========================================
+ Hits 756 768 +12
- Misses 30 31 +1
Continue to review full report at Codecov.
|
Thank you for your PR! I don't get why you can't reuse the same i18n instance. |
hi kazupon, in micro-frontend architecture we usually wrap vue apps in webcomponent to reuse as independent widgets in other SPAs. As for vue component option design if you happen to destroy and recreate one of these apps (for ex routing from a page to another and back) you find the widget plugins (store, router, i18n for example) to maintain their state since even if the vue app is destroyed, the reference of the plugin that will be taken by the new vue app is the same. |
Hi there, It could be useful for me too. |
Hi @Silentscripter 😄 Let me confirm our (vue-i18n maintainers) understanding regarding your description #592 (comment).
Am I on the right track ? |
hi @exoego , I confirm you are on the right track :) |
@Silentscripter |
Co-Authored-By: TATSUNO Yasuhiro <ytatsuno.jp@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@kazupon |
@kazupon |
@exoego personally, I don't prefer micro-frontend, because it's complicated. |
@kazupon honestly I don't get your point. The fact you don't prefer micro frontend doesn't mean it should not be fine in certain situations. There are lots of blog posts and articles regarding the adoption of micro frontend architectures in various industries. |
@kazupon I am following the thread because I'm involved in this topic too. Moreover, the solution proposed has been successfully adopted inside another vue-library, vuex, as mentioned by @Silentscripter |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #592 +/- ##
=======================================
Coverage 96.11% 96.12%
=======================================
Files 10 10
Lines 797 799 +2
=======================================
+ Hits 766 768 +2
Misses 31 31 ☔ View full report in Codecov by Sentry. |
Just to advocate micro-frontends architecture, here is one use case not mentioned: |
In some situations (for ex. micro-frontend environments where vue apps are wrapped in web-components) it would be good to have different VueI18n instances when a wrapped vue app is destroyed and recreated (since normally the VueI18n is created before and referenced in Vue component options).