Skip to content
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

Update documentation to replace jsconfig.json with tsconfig.json for Volto Version 17 #901

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aniket7r
Copy link

@aniket7r aniket7r commented Dec 10, 2024

issue #815 fixed

This PR updates the documentation to reflect changes introduced in Volto Version 17, where tsconfig.json is used instead of jsconfig.json for configuring add-ons and managing development packages.

Key Changes:
Replaced all mentions of jsconfig.json with tsconfig.json.
Updated configuration examples to use tsconfig.json.
Clarified the deprecation of jsconfig.json and the shift towards tsconfig.json.
Adapted instructions for mrs-developer integration to reference tsconfig.json.

If there are any specific areas that need further clarification or testing, please let me know!

I, Aniket Kumar, agree to have this contribution published under Creative Commons 4.0 International License (CC BY 4.0), with attribution to the Plone Foundation.


📚 Documentation preview 📚: https://plone-training--901.org.readthedocs.build/

@stevepiercy
Copy link
Contributor

@aniket7r please read and follow Contributing to Plone Training. We cannot accept a pull request without your written permission.

@aniket7r
Copy link
Author

@stevepiercy I have updated the pull request description

Copy link
Member

@ichim-david ichim-david left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aniket7r this is fine, thank you for your fix. @stevepiercy from my point of view you can merge this pull request whenever you want.

@stevepiercy
Copy link
Contributor

There's been significant changes to Volto add-on development with the release of Volto 18. This training looks like it was written for Volto 15. I'm concerned that this training no longer works as published, even though these changes are a necessary step forward. Maybe we need to tell the reader to checkout 15.x.x and call it done?

I'm waiting for the @plone/volto-team or authors to revise it so it works. It's on the agenda for later today.

@ichim-david
Copy link
Member

There's been significant changes to Volto add-on development with the release of Volto 18. This training looks like it was written for Volto 15. I'm concerned that this training no longer works as published, even though these changes are a necessary step forward. Maybe we need to tell the reader to checkout 15.x.x and call it done?

I'm waiting for the @plone/volto-team or authors to revise it so it works. It's on the agenda for later today.

@stevepiercy I think you are overthinking the potential outdated info. Given the fact that since 2 versions taconfig is the default if someone wants to try it from scratch and use generator volto they will get this file. Not to mention the fact that there is a jsconfig.json remark added.

We're over complicating a easy fix working about future fixes that don't address this one and thus should be added in other pull requests

@stevepiercy
Copy link
Contributor

@ichim-david I'll let this link https://training.plone.org/voltoaddons/01-addon-basics.html#bootstrap-a-new-volto-project explain the first of many problems I describe. See also plone/volto#6541 (review).

@ichim-david
Copy link
Member

@ichim-david I'll let this link https://training.plone.org/voltoaddons/01-addon-basics.html#bootstrap-a-new-volto-project explain the first of many problems I describe. See also plone/volto#6541 (review).

@stevepiercy It's all valid if you follow it you get a volto project created. Generated is still there to make projects for 17 if you still need it. Just because something is deemed deprecated doesn't mean it's also obsolete to the point where it no longer works.

There is nothing really obsolete about this training since it was made by @tiberiuichim which made the add-on story happen. You could add an info to the start that it assumes the Volto 17 generator but you could also add a cookieplone link for ppl that want to follow.
In both cases they will get the tsconfig. 15.x.x is not supported forever, and 16.x.x is security fixes and I doubt that someone will use 16.x.x now to follow along the tutorial.

The TLDR:
this tutorial works 100% on 17.x.x and even within the 16.x.x generated project the razzle checks for tsconfig as you can see from here
https://github.com/plone/volto/blob/16.x.x/packages/generator-volto/generators/app/templates/razzle.config.js#L10
where it uses tsconfig if it's found.

Again future changes can be made to the training but this change ain't the problem that needs further discussion.

@stevepiercy
Copy link
Contributor

Please try walking through the tutorial as written, either with or without the changes. Don't take my word for it. Let me know your thoughts then.

Here's what I tried.

$ npm install -g yo
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

added 25 packages, removed 58 packages, and changed 748 packages in 12s

132 packages are looking for funding
  run `npm fund` for details
npm notice
npm notice New major version of npm available! 10.8.1 -> 11.0.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.0.0
npm notice To update run: npm install -g [email protected]
npm notice

 00:10:08  stevepiercy@Steves-MacBook-Pro  ~/projects/Plone  🐍 3.12.2 3.11.5 3.10.13 system  ⬡ v20.10.0  12s 
$ npm install -g @plone/generator-volto
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: This package is no longer supported. Please use @npmcli/package-json instead.
npm warn deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.

added 16 packages, removed 184 packages, and changed 474 packages in 4s

54 packages are looking for funding
  run `npm fund` for details

 00:10:29  stevepiercy@Steves-MacBook-Pro  ~/projects/Plone  🐍 3.12.2 3.11.5 3.10.13 system  ⬡ v20.10.0 
$ yo @plone/volto volto-tutorial-project
This version of the generator works for Volto version 18.x.x.
If you want to generate a project for another version of Volto
then use the appropriate version.
See https://6.docs.plone.org/volto/contributing/version-policy.html#volto-generator-compatibility-with-volto-label.

Getting latest Volto version
Using latest released Volto version: 18.3.0
? Would you like to add addons? false
...
Done. Now run 'yarn' to install dependencies

 00:12:19  stevepiercy@Steves-MacBook-Pro  ~/projects/Plone  🐍 3.12.2 3.11.5 3.10.13 system  ⬡ v20.10.0  1m42s 
$ cd volto-tutorial-project             

 00:14:10  stevepiercy@Steves-MacBook-Pro  ...projects/Plone/volto-tutorial-project  🐍 3.12.2 3.11.5 3.10.13 system  ⬡ v20.10.0 
$ yarn start
Internal Error: volto-tutorial-project@workspace:.: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile
    at OR.getCandidates (/Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:435:5209)
    at Bd.getCandidates (/Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:391:1281)
    at /Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:439:7764
    at Tg (/Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:390:11154)
    at ce (/Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:439:7744)
    at async Promise.allSettled (index 0)
    at async ho (/Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:390:10446)
    at async /Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:439:8292
    at async di.startProgressPromise (/Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:390:48066)
    at async ze.resolveEverything (/Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:439:6285)

According to @davisagli, @plone/generator-volto does not work in Volto 18, and is not merely deprecated. The console output supports that statement.

@ichim-david
Copy link
Member

Please try walking through the tutorial as written, either with or without the changes. Don't take my word for it. Let me know your thoughts then.

Here's what I tried.

$ npm install -g yo
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

added 25 packages, removed 58 packages, and changed 748 packages in 12s

132 packages are looking for funding
  run `npm fund` for details
npm notice
npm notice New major version of npm available! 10.8.1 -> 11.0.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.0.0
npm notice To update run: npm install -g [email protected]
npm notice

 00:10:08  stevepiercy@Steves-MacBook-Pro  ~/projects/Plone  🐍 3.12.2 3.11.5 3.10.13 system  ⬡ v20.10.0  12s 
$ npm install -g @plone/generator-volto
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: This package is no longer supported. Please use @npmcli/package-json instead.
npm warn deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.

added 16 packages, removed 184 packages, and changed 474 packages in 4s

54 packages are looking for funding
  run `npm fund` for details

 00:10:29  stevepiercy@Steves-MacBook-Pro  ~/projects/Plone  🐍 3.12.2 3.11.5 3.10.13 system  ⬡ v20.10.0 
$ yo @plone/volto volto-tutorial-project
This version of the generator works for Volto version 18.x.x.
If you want to generate a project for another version of Volto
then use the appropriate version.
See https://6.docs.plone.org/volto/contributing/version-policy.html#volto-generator-compatibility-with-volto-label.

Getting latest Volto version
Using latest released Volto version: 18.3.0
? Would you like to add addons? false
...
Done. Now run 'yarn' to install dependencies

 00:12:19  stevepiercy@Steves-MacBook-Pro  ~/projects/Plone  🐍 3.12.2 3.11.5 3.10.13 system  ⬡ v20.10.0  1m42s 
$ cd volto-tutorial-project             

 00:14:10  stevepiercy@Steves-MacBook-Pro  ...projects/Plone/volto-tutorial-project  🐍 3.12.2 3.11.5 3.10.13 system  ⬡ v20.10.0 
$ yarn start
Internal Error: volto-tutorial-project@workspace:.: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile
    at OR.getCandidates (/Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:435:5209)
    at Bd.getCandidates (/Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:391:1281)
    at /Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:439:7764
    at Tg (/Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:390:11154)
    at ce (/Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:439:7744)
    at async Promise.allSettled (index 0)
    at async ho (/Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:390:10446)
    at async /Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:439:8292
    at async di.startProgressPromise (/Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:390:48066)
    at async ze.resolveEverything (/Users/stevepiercy/projects/Plone/volto-tutorial-project/.yarn/releases/yarn-3.2.3.cjs:439:6285)

According to @davisagli, @plone/generator-volto does not work in Volto 18, and is not merely deprecated. The console output supports that statement.

@stevepiercy you didn't properly follow the install instructions, you wrote yarn start instead of yarn only which is the equivalent of yarn install.
Again you cling on the generator install and what technique to use while I am strictly talking about the change of this pull request which is valid as it is.
You want more info, added, fine it can be done in another issue alongside every training that can benefit from having this info since it's still valid.
Besides you've mentioned the training archiving and having newer versions depending on release.

This is my last comment on this issue, I trust your judgment to make the right call on every training modification you think is needed in whatever pull requests or issues that are needed.

@stevepiercy
Copy link
Contributor

I copied the instructions from the Training.

Screenshot 2024-12-17 at 12 35 24 AM

The instructions are now out of date with Volto 18.

Keeping incorrect information on the current Training site is bad for learners. I'm inclined to remove this training without merging this PR.

That's drastic, but might be necessary. I would much prefer that someone run through and update this training so that it works for whatever versions of Volto they decide, as long as that is clear up front to the reader. If someone does that, and this PR aligns with that update, then I would have no objection to merge this PR.

@ichim-david
Copy link
Member

I copied the instructions from the Training.

Screenshot 2024-12-17 at 12 35 24 AM

The instructions are now out of date with Volto 18.

Keeping incorrect information on the current Training site is bad for learners. I'm inclined to remove this training without merging this PR.

That's drastic, but might be necessary. I would much prefer that someone run through and update this training so that it works for whatever versions of Volto they decide, as long as that is clear up front to the reader. If someone does that, and this PR aligns with that update, then I would have no objection to merge this PR.

@stevepiercy all training ends up somewhat obsolete from year to year and need to be updated. @aniket7r decided to take his time to contribute to open source and fix one issue that he has flagged.
I don't think that his work should be dismissed just because you found another issue, instead an issue should be added and perhaps someone else will choose to work on it.

A better approach would be to merge this pull request, add a notice that this was made during the 16.x.x and 17.x.x era and that pull requests are encouraged if issues are found with 18.
It still contains information not described in other training or the docs itself.
It will be a loss to those that need to get this information if it's removed. Again you are clinging on the installation which is always part of check the latest docs on how to install when the real value is what it teaches as a training.

Be less drastic about this and allow this work to be merged. I remember me and @sneridagh saying something about a pull request from @robgietema where we wanted some changes and his reply was simply outside of this pull request scope, feel free to open another pull request if you want that changed or implemented. In the end Victor agreed and merged it.

In the same way I think with this work, merge it and add an issue for the next issues to be tackled in a future pull request.

@stevepiercy
Copy link
Contributor

It's already archived at https://2023.training.plone.org/voltoaddons/index.html, so it can still be found even if we remove it from the current trainings.

It's already on the Volto Team meeting agenda today to discuss what to do with this and other out of date Volto trainings. I've been pushing this since June 17, and got zero response. If no one cares to fix broken trainings, then they go away from the current training site.

@ichim-david
Copy link
Member

@stevepiercy I will update this training to bring it up to par after this pull request is merged, sometime before the end of the year.
I'm thinking of adding similar info such as the warning here:
https://training.plone.org/effective-volto/architecture/bootstrap-volto.html#bootstrap-volto
Or remove the install info altogether and just link to the docs for each version that the user is working on.

I also plan to add the youtube links to the training https://www.youtube.com/watch?v=2itgnnNU3tM
and https://www.youtube.com/watch?v=kKPVvlxkxsg
I will see about some chapter links so that if the user has their volto installed they don't need to spend time
looking at that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Approved
Status: Work approved
Development

Successfully merging this pull request may close these issues.

3 participants