-
Notifications
You must be signed in to change notification settings - Fork 6
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
Svelte widget #299
base: master
Are you sure you want to change the base?
Svelte widget #299
Conversation
efad5b5
to
72ca2e6
Compare
@@ -27,7 +29,11 @@ | |||
"npm-run-all": "^4.1.5", | |||
"parcel": "^2.10.0", | |||
"rimraf": "^5.0.5", | |||
"typescript": "^5.2.2" | |||
"typescript": "^5.2.2", | |||
"@tsconfig/svelte": "^5.0.2", |
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.
Please remove @tsconfig/recommended
as a dependency, since it's no longer used.
"django-s3-file-field": "file:../javascript-client" | ||
"django-s3-file-field": "file:../javascript-client", | ||
"svelte": "^4.2.0", | ||
"svelte-preprocess": "^5.0.4" | ||
}, | ||
"devDependencies": { |
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.
Sort the devDependencies
list.
"typescript": "^5.2.2", | ||
"@tsconfig/svelte": "^5.0.2", | ||
"parcel-transformer-svelte3-plus": "^0.2.10", | ||
"process": "^0.11.10", |
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.
Remove process
, unless it's somehow needed.
@@ -0,0 +1,8 @@ | |||
{ |
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.
(This file is JSON5](https://parceljs.org/features/plugins/#.parcelrc), so let's use the same 2-space indent as other files.
Go ahead and add this file name to .editorconfig
too.
@@ -0,0 +1,5 @@ | |||
const sveltePreprocess = require('svelte-preprocess') |
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.
It looks like this file may not be necessary at all: https://github.com/HellButcher/parcel-transformer-svelte3-plus#configuration
If we do need it, I'd rather use .svelterc
as a declarative JSON format, instead of svelte.config.js
, if possible.
"src/**/*.ts", | ||
"src/**/*.js", | ||
"src/**/*.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.
Why are these necessary? Aren't they matched by *
?
"env": { | ||
"node": true | ||
}, |
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.
Why? We're compiling something for the browser, not Node.
console.log(arguments); | ||
</script> | ||
|
||
<h1>Hello {name}!</h1> |
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.
parcel-transformer-svelte3-plus
is going to automatically enable svelte-preprocess
for us (if it's installed), so we can use the template tag feature: https://github.com/sveltejs/svelte-preprocess#template-tag
So, I'd suggest wrapping the HTML in .svelte
in <template>
tags.
@@ -0,0 +1,25 @@ | |||
declare module '*.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.
Is any of this file necessary? Did you follow a tutorial that suggested creating this, or was it necessary to create by hand?
No description provided.