-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Internal Reorganization & Related Documentation #13
Conversation
- split them into files instead of command-line args in package.json scripts - webpack has a config file ofc, but wanted to keep them consistent initially, so used command-line - decided to use the browserify API as its "config file" - this actually took a decent amount of research to figure out how to output to file (have to pipe to fs stream)
7cd3498
to
3c9bb4e
Compare
- speeds up builds - tests still pass, so I think it's okay to do, but this may be different from how developers use it so not necessarily ideal test-prod parity - though it may make sense to advocate for noParse as performance optimizations - getting three to be properly require'd as an external with webpack meant I had to use libraryTarget for some reason... - otherwise it would expect it as a global
- going to move tests there too in order to declutter app root
- app root has a lot of files in it, this should help declutter a bit
- having the build configs in app root made it kind of seem like they were being used to produce the library's export, but they're solely used for testing purposes - so moving them into test/ seems to make sense to me - also to declutter app root similar to previous commits - use process.cwd() in webpack config as __dirname is no longer app root, but process.cwd() still is as it's still called from package.json scripts
- upon further testing, ammo was still being parsed by browserify until now - had to time both webpack and browserify in order to tell it wasn't being parsed, as they don't error if the module isn't found - but they both compile significantly faster when it's not, so that's how I could tell I did it correctly (probably could've used verbose mode as well) - webpack was not parsing it, but had to double check - browserify apparently only uses absolute paths, so require.resolve is the primary way of using noParse (would be great if this were better documented...) - while this is not strictly necessary for webpack, and it was working prior to this, changed the webpack config to use require.resolve as well for consistency
3c9bb4e
to
7a9c1b5
Compare
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.
Content looks mostly good, just some small changes anc considerations!
- Made a few spot-check fixes and commit message improvements in the first pass before officially reviewing.
- Read through the markdown files on the actual GitHub branch to confirm how they look and read
- Tests still pass on CI!
Might want to consider adding a publish commit here as well as throwing in a CI upgrade to Node 10 Active LTS... or do both separately?
- this makes it more explicit why it's been vendored in -- it has incompatible changes -- and makes more explicit what those changes are with documentation (instead of just commit messages) - it also explains why those changes were made, with lots of links as there's a decent bit of context around that - and this context is key to what made this library possible, so it's good to have finally documented it! - also add the same worker links to the app root README for anyone who might want more info on those - (pkg): modify package.json files config so that this new README isn't included in the package
96172aa
to
25af44b
Compare
- this is likely an area of concern for users and may even be a barrier to adoption for this library, so document it directly in the README to reach the greatest amount of people - some users may not even know these optimizations exist, so this should particularly help them in getting up to speed (pun intended) - major downside of documenting this officially is that it must now be supported / maintained -- namely, this means that changing the path to ammo.js would now be considered a breaking change - but this library doesn't go through many changes and all that physijs code has been split into its own directory, so that's a trade-off I'm willing to make
70c4b1b
to
fac587b
Compare
- made a lot of iterations on the bundler perf section just to really make it explicit that it's optional, but honestly the best way to do that is to just take it out of the README entirely - now its still linked to in the README, but not attracting a lot of attention to itself - downside of this is of course that less people who need it actually see it, but better than turning off users early with lots of config - README is tiny though, so it should still be easily noticeable - and hopefully the big blue hyperlinked heading makes it easily noticeable as well, so that hopefully prunes the downside quite a bit
fac587b
to
2cd7696
Compare
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, iterated a ton of times on getting the bundler perf section to look explicitly optional, and noticeable, but not attracting too much attention to itself or looking unwieldy to new users... think we've finally got a balance here by splitting it out into a separate file but giving it a big heading hyperlink in the README!
all the other changes look good too 👍
Notably, even on CI, the webpack build time improved by an order of magnitude, from ~3272ms
to ~319ms
. This isn't a big difference for our CI, which runs under a minute and this basically fits into the margin of error, but for users constantly building apps that use physijs-webpack
, that's a huge difference, especially for slower machines. Good to see 🙂
b0f2eef
to
ae5d1ed
Compare
no API surface changes - the physijs code (physi.js, physijs_worker.js, and vendor/ammo.js) has all been moved from app root to physijs/ - usage of the internal physijs code was not supported or documented before, but if you were somehow relying on that, it has now changed docs improvements - adds a Bundler Performance Optimizations doc that mainly details how one may use the `noParse` config on `ammo` to speed up build times - adds a README to the physijs code to more explicitly describe what kinds of modifications were made to it to work for our use case - only reports master branch's build status in app root README internal improvements - optimizes test bundle speed with the `noParse` option - reorganizes code into directories to declutter app root - splits out the test build config from package.json scripts into their own config files - fixes changelog issues with the package.json repository field format
ae5d1ed
to
7485a33
Compare
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, well adding a commit here to upgrade CI to Node v10 Active LTS somehow caused even more test errors, so removed that and just added a publish commit and that's all.
Since there's added docs here that rely on the new physijs/
directory, I definitely think this should be published as soon as it is merged to reduce any potential for confusion. Should be good to merge whenever!
With regard to the failing tests, will likely have to move the tests to cypress
or a headless browser to get everything to work correctly.
noParse
andexternals
ammo
physijs
modifications this library has made