-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Some breaking changes for 0.11 #65
Conversation
These are all great thank you, exporting Let me wrap my head around the changes for a little bit, I don't want to rush breaking changes, but will highly likely merge these during this week. If you have more changes planned let me know so I'll wait a bit so I can do everything in one go :) |
Nothing planned much. But yeah, no hurry, take time. For record just now I experimented with adding a preprocess to add |
76644c7
to
d82eb87
Compare
I looked into updating svelte version in package json from 3 to 4. There is an import in hooks from Question: Why |
So, actually preprocess does work, append Marked it as external for esm/cjs build. But not for cdn/cdn_min because I am not sure if it is ok to do so. Does cdn support |
9b518bf
to
a2ab7ee
Compare
Looked at it just now, I've merged some of the more simple and straightforward commits, feel free to rebase on master, it should make this PR a little bit smaller already. There's still a couple of things I'm not sure about, let me go over them and we can handle them one by one. Probably most changes are ok to go, I just want to make sure I understand them correctly. - pushEvent/pushEventTo -> live change
I don't see this error, I have - Replace render/exportSvelteComponents with getRender - The preprocess commit a2ab7ee Will this work if you do something like this?
It feels brittle to me to fix this with a preprocesser, the above case is not handled I think. |
a2ab7ee
to
681c445
Compare
681c445
to
6c79493
Compare
Ok, I rebased, split last commit into two - about render and about refactor in hooks, removed preprocessor commit.
Strange, as you can see from linked code unless $$props or $$restProps are used there should be a warning for an unknown prop in dev mode. And I do get it, for example by going to example number 1, Removed preprocessor for now, yeah it is not perfect, I don't think you can make an ideal one, there are tradeoffs to be made. It is an optional thing anyway, so can be forgot about for now. |
Ok nvm I see the error now. Thanks for the quick response, I'll take a look at everything again now! |
Merged the changes, thanks for the great work :) |
Available in |
Nothing too drastic but still will require small simple migrations steps from users.
Move ssr build from priv/static/assets into priv/svelte
priv/static/assets
files are exposed throughPlug.Static
,priv/static
files are digested and compressed withphx.digest
task. Neither of those things need to apply to ssr build, so changed it location topriv/svelte
.Migration: a user will need to update
optsServer.outdir
inbuild.js
and addpriv/svelte
to gitignore.Set
dev
in svelte compiler optionsActivate dev mode in non-deploy builds for svelte. It enables various things like
@debug
tag and logs warnings on improper usage of components. (Not a breaking one since it applies only toassets/copy
.)Instead of
pushEvent
/pushEventTo
pass live hook withlive
propUnless user exports both
pushEvent
andpushEventTo
svelte complains about passing of unknown props in dev mode. It is annoying and unfortunately there is no way to check if a component exports those... To limit that annoyance replacepushEvent
/pushEventTo
with a single proplive
and pass live hook instance into it so now to remove that warning exporting that prop is enough. It also gives a user access to more of live view capabilities -handleEvent
/removeHandleEvent
/upload
/uploadTo
.Migration: need to replace
export let pushEvent
withexport let live
andpushEvent
calls withlive.pushEvent
.Replace
render
/exportSvelteComponents
withgetRender
exportSvelteComponents
was needed because there was usage ofrequire
anddelete require.cache
in ssr render function. But that usage has been removed already, so api can be changed to more clean one. (That commit also contains somewhat subjective clean up of internal js.)Migration: need to replace three lines in
assets/js/server.js
with two shorter ones.This PR is based on previous not-yet-merged about typescript definitions and split into corresponding four commits for git history readability.