Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

#227 -- Support Transition Directive on Components #230

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

TristanHoladay
Copy link
Contributor

@TristanHoladay TristanHoladay commented Jun 27, 2023

…ning into lots of errors with importing a custom preprocessor into the svelt.config.js as well as getting things to play nicely with the svelte for vs code extension.
@TristanHoladay TristanHoladay linked an issue Jun 27, 2023 that may be closed by this pull request
@netlify
Copy link

netlify bot commented Jun 27, 2023

Deploy Preview for unicorn-ui ready!

Name Link
🔨 Latest commit 27a8c06
🔍 Latest deploy log https://app.netlify.com/sites/unicorn-ui/deploys/64e4b010238a3a0007950b01
😎 Deploy Preview https://deploy-preview-230--unicorn-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

… work for passing to the preprocessor group [] in svelte.config.js); made adjustments to the preprocessor currently in svelte.config.js.
@TristanHoladay
Copy link
Contributor Author

TristanHoladay commented Jun 29, 2023

the preprocessor concept seems to be working, removing the Transition compilation error (though there's still a type error for the return type of the transition function).

Screenshot 2023-06-28 at 7 43 07 PM

also still getting this error when trying to import the transition preprocessor into svelte.config.js:

[WebServer] error during build:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/tristanholaday/repos/UnicornUI/website/CustomPreprocessors/TransitionPreprocessor' imported from /Users/tristanholaday/repos/UnicornUI/website/svelte.config.js
    at new NodeError (node:internal/errors:400:5)
    at finalizeResolution (node:internal/modules/esm/resolve:326:11)
    at moduleResolve (node:internal/modules/esm/resolve:945:10)
    at defaultResolve (node:internal/modules/esm/resolve:1153:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:842:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
    at link (node:internal/modules/esm/module_job:76:36)
[WebServer] npm ERR! Lifecycle script `build` failed with error: 
[WebServer] npm[WebServer]  ERR! Error: command failed 
[WebServer] npm ERR! [WebServer]   in workspace: [email protected] 
[WebServer] npm ERR!   at location: /Users/tristanholaday/repos/UnicornUI/website[WebServer]  
Error: Process from config.webServer was not able to start. Exit code: 1

@TristanHoladay
Copy link
Contributor Author

TristanHoladay commented Jul 10, 2023

update:

after looking more thoroughly at the svelte source code it looks like we could use their exported runtime transitions / animation functions (i.e. create_bidirectional_transition()) to create and add the animation to the stylesheet of the component.

runtime transition functions

animation rule functions

Latest push has a somewhat hardcoded example of doing this with route test (/test/+page.svelte) and it works! If this is a desirable route, then we'll need to of course handle all the edge cases, recursion, etc...

… create_bidirectional_transition() in an onMount() -- right now it is working for the div in test +page.svelte but not for <Box>.
…lte internal import; updating TransitionPreprocessor class and tests.
…too existing onMount() or creating new one as well as adding a generic import for svelte/internal; added these to the setup in svelte.config.js for testing.
…, also added directly to svelte.config.js for testing with routes/test/+page.svelte -- now looks for ref and creates/binds if not found.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explore Supporting transitions.
1 participant