-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix/viewer errors #343
Fix/viewer errors #343
Conversation
jest coverage report 🧪Total coverage
|
some of this is already in #341 |
} from "../es"; | ||
FrontEndError, | ||
ErrorLevel, | ||
} from "../src/index"; |
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.
The original from "../es"
was there intentionally to help simulate an environment more like simularium-website where we are loading from the packaged build. This was relevant because of differences in the way the web worker and style sheets are loaded, for example. So if changing this, we should be intentional about it
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.
ok, it seemed like this was what was causing a lot of the typing errors and it means you don't have to rebuild to make sure all your changes are reflected in the app. I don't see any differences after changes these to the way the app behaves. do you know of something I could test?
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.
I had to change the server to production because the staging one is down, but I was able to load COVIDLUNG and it seemed to behave the same in both cases (changing the imports)
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.
This is expected to behave the same if you :
- use
from ../es
and runnpm build
beforenpm start
- compared to use
from ../src
and don't build before start.
Main thing to test is loading a trajectory with pdbs.
But the ../es case is more important to make sure things are working for production.
Being intentional probably means just keeping it easy to switch between the two (keep all the imports in this one statement if possible) and maybe put something in the readme, and a comment at the import to say what to do.
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.
no I know, I meant is there any behavior you know about that does behave differently in the two states? Because either way we're running the same commands, ie, npm start
calls npm build
and the dev server setup is supposed to serve the built artifacts just while watching for changes. I'm in favor of using the /src
because it removes the typescript errors so it's more obvious when we do have an actual error in the test bed viewer. But I can add a commented out import statement? Is that what you're suggesting?
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.
There should be no actual differences in runtime behavior between the two cases of importing from src vs es. In the past, however, there HAVE been differences which had to be fixed. Loading it here lets you find the error before you test in simularium-website. This is the reason why this demo app is loading from es/
.
There definitely shouldn't be any typescript errors when we import from the es/ dir, so if there are, maybe that means we need to make sure that the test app can see the type-declarations
directory.
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.
So I would like to keep the ability to run the test app with the post-build artifacts.
In order to support both situations (import from es and requiring a npm build, versus importing from src and not requiring a npm build) I would suggest a separate start
script in package.json and some kind of dev-or-production switch in the code. The alternative is to have a commented-out version of both like this:
import foo, bar, baz from 'src';
// import foo, bar, baz from 'es';
As long as there is only one place to do this, then you have to just change the comment to make it use the right thing. And then every PR from now on will have this comment/uncomment battle... 🤣
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!
Problem
The test bed viewer had a lot of errors, and it loaded files different than the web app, ie you had to click "load".
Solution
I loaded everything from the local files, and changed the "on change" function to just load the file immediately.
Type of change
Please delete options that are not relevant.