-
Notifications
You must be signed in to change notification settings - Fork 208
feat: import cdc files #192
Conversation
|
I think you can actually get away without using I realized we already load Cadence files in the fcl-dev-wallet project, which is also a Next app. It works by adding this line in |
that worked! but it seems the cdc files have to be within the nextjs project root. LMK if that impacts testability |
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!
|
Is there is a way to de-dupe the cadence files? |
Unfortunately Next requires that all loaded files are in the Next project root ( I came across this experimental feature to load external Typescript files: vercel/next.js#22867 Unfortunately it only seems to work for Typescript files and not arbitrary files loaded by Webpack. It might be possible to load files from Lastly, if we do eventually convert this whole project to a Next app and remove The other problem is that the web version of the Cadence files use the You can see here that the API replaces the file paths with addresses: https://github.com/onflow/kitty-items/blob/master/api/src/services/kitty-items.ts#L108-L123 @alxflw It'd be great to have some JS code that does this in a more generic way. It could be a nice utility that we use in both the API and web app. |
|
thanks for the input y'all. I'll focus on two things:
|
ok, I tried a few things but didn't end up with a working solution for now. details:
thoughts? |
|
I'd love to get this to the finish line for initial release @psiemens @10thfloor. I'll resolve the conflicts but please confirm that we exhausted our options to simplify (prior comment) |
psiemens
left a comment
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.
Looks good overall! Just a few cleanup comments.
I say let's stick with this for now and then separately investigate better tooling to handle Cadence imports.
psiemens
left a comment
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.
LGTM! 🚢
Congrats on first PR! 🎉
|
@10thfloor could you update your review so I could merge? |
This PR fixes #47
All Cadence files that were inline are now in the one of two folders:
web/cadence/transactions/<name>.cdcweb/cadence/scripts/<name>.cdccc @shubik22