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

Set up shared code between molecules-and-light and greenhouse-effect #19

Closed
jbphet opened this issue Apr 9, 2021 · 9 comments
Closed

Comments

@jbphet
Copy link
Contributor

jbphet commented Apr 9, 2021

The molecules-and-light sim is a subset of the greenhouse-effect sim, and in other cases that I've worked on where one sim is a subset of another, the more extensive "parent" sim contains all of the code for both. The atomic-interactions sim has this sort of a relationship with states-of-matter, where pretty much all of the code for the sim is in the states-of-matter repo. So, if we want to follow this pattern, most of the code for molecules-and-light should live here in the greenhouse-effect repo. The problem with doing it this way is that molecules-and-light was done quite a while ago, so there is a lot of code and issue history already in the repo, and there are also quite a few translations. Moving the molecules-and-light code into the newer greenhouse-effect repo would not be an easy task, and we might lose some information in the process.

@jessegreenberg may have run into a similar situation a while back, since I think he worked on energy-skate-park after the subset energy-skate-park-basics had already been published. @jessegreenberg - Do you have any insights based on your past experiences as to how to handle this situation? Feel free to label this for dev meeting if you think it might help to discuss it with the other developers.

@jessegreenberg
Copy link
Contributor

Here is the issue where we set up the shared code between energy-skate-park and energy-skate-park-basics phetsims/energy-skate-park#6.

We decided to create one main repo (energy-skate-park) and a thin shell for basics when was dependent on the main repo.

From phetsims/energy-skate-park#6 (comment), I used https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/duplicating-a-repository to duplicate the contents and history of energy-skate-park-basics into energy-skate-park to preserve the history. That worked because energy-skate-park was empty but greenhouse-effect already has sim code and history so we can't put a clone of molecules-and-light at this repo.

@jessegreenberg
Copy link
Contributor

jessegreenberg commented Apr 21, 2021

Perennial now has a copy-history-to-different-repo.sh which looks promising. Can use this on a directory or file to move things from molecules-and-light to this repo.

@jessegreenberg
Copy link
Contributor

I am using copy-history-to-different-repo.sh now to move things over, going through each subdirectory then moving things around. Taking some notes as I go through.

  • Did this for files under /doc, and added TODOs for these files to indicate stuff needs to be filled in for GHE things.

jessegreenberg added a commit that referenced this issue Apr 21, 2021
jessegreenberg added a commit that referenced this issue Apr 21, 2021
jessegreenberg added a commit that referenced this issue Apr 21, 2021
jessegreenberg added a commit to phetsims/molecules-and-light that referenced this issue Apr 22, 2021
@jessegreenberg
Copy link
Contributor

The contents of molecules-and-light have been moved to greenhouse-effect including assets, images, mipmaps, and sounds and code. Most code from molecules-and-light has been moved under the micro subdirectory, since molecules-and-light will mostly borrow from that screen.

I verified that history was preserved by checking history of several files under micro.

I expect some things could move out of micro and into common or maybe back into molecules-and-light for some components that aren't used in greenhouse-effect. But since we don't have a mockup for the micro screen yet, I moved everything over eagerly to finish getting the relationship set up.

Next, I will start removing things from molecules-and-light and pulling from greenhouse-effect.

@jessegreenberg
Copy link
Contributor

I think this is done. molecules-and-light is now a shell that pulls almost all code from greenhouse-effect. As mentioned in #19 (comment) I suspect that things could be moved back into molecules-and-light if there are components that are specific to that sim. We will do that when we have a mockup for the micro screen.

Regarding strings, all strings have been moved into greenhouse-effect except those that are used for the molecules-and-light KeyboardShortcuts Dialog.

@jessegreenberg
Copy link
Contributor

@jbphet I wanted to reassign to you in case you wanted to spot check in case I missed anything. Otherwise I think this can be closed.

jbphet added a commit to phetsims/molecules-and-light that referenced this issue Feb 22, 2023
@jbphet
Copy link
Contributor Author

jbphet commented Feb 23, 2023

I've reviewed this and made a few minor commits, and I think we're good to go. There will need to be a fair amount of work done on the code in the micro directory before doing much with it, such as porting it to TypeScript and making sure that the appropriate things are shared with the rest of the greenhouse-effect code. Also, there is an issue about moving the translated strings at some point, see phetsims/molecules-and-light#382. We will attend to all of this when starting work on the Micro screen. Closing.

@jbphet jbphet closed this as completed Feb 23, 2023
@phet-dev phet-dev reopened this Jul 13, 2023
@phet-dev
Copy link
Contributor

Reopening because there is a TODO marked for this issue.

@jbphet
Copy link
Contributor Author

jbphet commented Jul 18, 2023

I created a new, more specific issue to which to link the TODO in the code and have updated the reference. Re-closing.

@jbphet jbphet closed this as completed Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants