-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
[Feature request] Native browser support #2427
Comments
This is solved in version 5: https://tolgee.io/js-sdk/installation |
Actually, the very same error occurs when using the following : import { Tolgee, TolgeeProvider, T, VueTolgee } from 'https://cdn.jsdelivr.net/npm/@tolgee/vue/dist/tolgee-vue.esm.min.mjs'; Thanks |
Ah, you are right, sorry |
I was able to make it work like this: <script type="importmap">
{
"imports": {
"vue": "https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.esm-browser.js",
"@tolgee/web": "https://cdn.jsdelivr.net/npm/@tolgee/[email protected]/dist/tolgee-web.production.esm.min.mjs",
"@tolgee/vue": "https://cdn.jsdelivr.net/npm/@tolgee/[email protected]/dist/tolgee-vue.esm.min.js"
}
}
</script>
<script type="module">
import { createApp } from 'vue';
import { Tolgee, TolgeeProvider, T, VueTolgee } from '@tolgee/vue';
... I think you need an importmap for this - @toglee/vue is dependant on @tolgee/web and vue, so it needs to be clear where to get them. |
Firefox and Safari have only been supporting |
I don't know if we can solve this differently. |
Hello, |
Hey, no, I think we'd have to put everything into one package, which I don't really like. |
However, I think you can use the umd imports though |
How opinionated. |
I don't see a solution how to provide the support for this when our package has a dependency on a vue package. If you have a solution, feel free to provide it 🙂 |
If you mean the Vue package, then If you mean a Vue package as in Thanks |
Could you maybe explain a bit more the usecase for this. It feels like in order to make this work, it would require a special case of bundling the vue package and I don't see very big value in it. If this is something important, could you clarify that? I'm unfortunately not so experienced with vue ecosystem, so maybe thats why I don't understand the value. |
As I mentioned, if it's the Vue package, then don't bundle it, but allow the user to pass it in
Vue is usable both with and without bundler. Meanwhile, Tolgee is currently only usable with bundler. |
Ok, I think I'll leave the issue open for potential contributors, as I don't see this as a priority fix, but more like "make it better for vue ecosystem" thing. |
Hello,
The following boilerplate :
Outputs the following error :
Which can currently only be fixed using the following import code :
Indicating that Tolgee JS doesn't provide native browser support, thus the need of JSPM, which converts CJS into browser-compatible ESM.
Demo on JSFiddle
Thanks
The text was updated successfully, but these errors were encountered: