Will the new update break compatibility? (Asset keys)

Hallo everyone,
I just wanted to ask whether the new update could break compatibility with code from the previous versions.
I’m interested in the new asset features but I use “assetList”, saveText/loadText and a lot of “Documents:…”. Will those functions still work or will my project fail to run? I don’t want to risk breaking my projects since downgrading to a previous version isn’t possible anymore after updating.

Secondly, I read something in the description of the latest update about subfolders in projects and being notified about changes in “MyFolder”. Does that mean that Codea projects (exported) can have integration with the Files app or is this restricted to the development process? Could this be opened up to exported projects and is it possible for exported Codea projects to import new files such as images into its folder?

Thanks in advance :slight_smile:

assetList is deprecated but works. and it’s not usually hard to replace it with current stuff.

Thanks!
Do the other commands (saveText specifically) work as well?

I will replace them eventually, but in larger projects, that’s a lot of work :confused:

@Leon saveText will continue to work with the string version but nearly anywhere you can use the "Documents:MyFile" syntax you can replace it with an asset key (asset.documents.MyFile). Using the string variant of some functions will print a warning that you should asset keys, but that’s the main change.

Please post here if you run into trouble

@Simeon Thanks, that’s great to hear!

Does it also print a warning in an exported App? I use the parameter window, so any print on the console would be visible.

I hope it’s okay, if I repeat my second question :slight_smile: :
I read something in the description of the latest update about subfolders in projects and being notified about changes in “MyFolder”. Does that mean that Codea projects (exported) can have integration with the Files app or is this restricted to the development process? Could this be opened up to exported projects and is it possible for exported Codea projects to import new files such as images into its folder?

Yes it will print warnings in an exported app

On the second, yes you can integrate with the files app by monitoring a folder. For example, to monitor the documents folder for your app:

asset.documents.updated = function(lib) 
    -- lib is the asset key for the documents folder
    print("Num files:", #lib)

    for _,file in pairs(lib.all) do
        -- scan through all the files to see what changed...
        print(file.name)
    end
end

@Simeon Thank you!

That’s fantastic, great to hear that :slight_smile: