-
Notifications
You must be signed in to change notification settings - Fork 10
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
ESM+webpackification of the engine code #262
Conversation
@Carifio24 @imbasimba OK, I think we have a workable approach here. The combination of ESLint and ESBuild seems to work to help ensure that there aren't any mistakes in the code rearrangements. At the moment I've gone through and rearranged code in the |
This includes deleting some debug code from with MainView.cs.
Here, we delete the outermost pieces of `js/transpiled.js` to dedent the entire file. This breaks the build and the functionality of the code. It will take us a few commits to get things back into working order.
To move over to the new build framework, we're going to need a few extra interface points with the ScriptSharp infrastructure.
These will make it a bit more convenient for newer code to interact with the ScriptSharp type system. Eventually we'd like to drop that type system altogether, but the `ss.canCast` functionality is something that we don't want to futz with just yet.
Use ES6 imports and exports, building on our typesystem helpers.
Things should be functional again. The big win here is that now we can gradually break `transpiled.js` into separate source files, using `import` and `export` statements to modularize the code.
…mation It turns out that we have to get a lot of stuff into place for `astrocalc/elliptical.js` to work, but it's all pretty mechanical.
…e wrong Selection type
The `#version` command, if present, needs to be on the first line of the shader program, so our previous formatting wasn't fully working.
2263ae2
to
1a56bf8
Compare
I have tested as much downstream functionality as I could (web client, pywwt, apps) and I believe this is ready to merge. |
This pull request builds on #261. It switches the engine module to build with Webpack, allowing us to more conveniently break the code into individual files using ES6 imports and exports (while compiling down to code that's compatible with the ScriptSharp implementation). As a sample I've extracted one of the first modules.
This transition unfortunately involves another large batch of code churn to set things up, but the later commits in this pull request ought to be readable. (Note that, as long as #261 is unmerged, the diffs and commit list for this PR will include the ones in that PR as well.)
Also, we're not importing comments from the astrocalc C# code since it's already awkward code that was auto-translated from C++ in the Microsoft days, and these routines are about as locked-in as code can get.