-
-
Notifications
You must be signed in to change notification settings - Fork 356
[Doc] Add resolve condition names to UX Svelte documentation #1689
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
[Doc] Add resolve condition names to UX Svelte documentation #1689
Conversation
src/Svelte/doc/index.rst
Outdated
@@ -51,6 +51,19 @@ Next, install a package to help Svelte: | |||
That's it! Any files inside ``assets/svelte/controllers/`` can now be rendered as | |||
Svelte components. | |||
|
|||
To make internal functions work in Svelte, such as ``onMount``, ``onDestroy``, etc, |
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.
Could you add a link to the documentation you mention?
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.
Yes, sure! I got this link:
https://svelte.dev/docs/v4-migration-guide#browser-conditions-for-bundlers
Should I add it to the documentation?
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.
Yes perfect!
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.
Great. I will do it tomorrow. 👍
src/Svelte/doc/index.rst
Outdated
@@ -51,6 +51,19 @@ Next, install a package to help Svelte: | |||
That's it! Any files inside ``assets/svelte/controllers/`` can now be rendered as | |||
Svelte components. | |||
|
|||
To make internal functions work in Svelte, such as ``onMount``, ``onDestroy``, etc, |
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.
Maybe we should mention those steps are needed when you want to use svelte 4? You don't have this kind of issue in version 3?
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.
Yes, you are right. I will mention this.
src/Svelte/doc/index.rst
Outdated
|
||
// module.exports = Encore.getWebpackConfig(); | ||
const config = Encore.getWebpackConfig(); | ||
config.resolve.conditionNames = ['browser', 'svelte']; |
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.
In the documentation you send, they motion also an import item. Do you think we should added to?
conditionNames: ['svelte', 'browser', 'import']
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.
Agree. I will add it too.
src/Svelte/doc/index.rst
Outdated
@@ -51,6 +51,19 @@ Next, install a package to help Svelte: | |||
That's it! Any files inside ``assets/svelte/controllers/`` can now be rendered as | |||
Svelte components. | |||
|
|||
To make internal functions work in Svelte, such as ``onMount``, ``onDestroy``, etc, |
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.
Yes perfect!
@WebMamba I think we need to consider one more thing: When I create a new Symfony app, install the UX Svelte bundle, install all the necessary NPM dependencies and type That's how it came to my attentien that when you use Svelte 4, you will have to do a bit more configuration where you will have to add Should I add this too? |
Hummm I think it's fine, the error message is really good. Just specify in the doc that this config is needed for svelte 4 |
6e1a0c4
to
400deee
Compare
Kasper, thanks for this nice contribution and for your patience during the review process (thanks also to Matheo for the nice review). Your contribution was perfectly correct, but while merging I changed the code example to show a |
@javiereguiluz you are welcome! And using the |
This PR will enhance the UX Svelte documentation. As of yet, some internal functionality will not work in Svelte unless you add
browser
andsvelte
to theconditionNames
. I think it is valuable to mention this in the documentaiton.