Skip to content

130 unpack main #29

@JonathonDunford

Description

@JonathonDunford

Issue by activescott
Sunday Mar 18, 2018 at 10:58 GMT
Originally opened as https://github.com/forkdelta/forkdelta.github.io/pull/131


NOTE: I suggest we ignore the content below here and use the PR for the latest information at #35

This definitely needs a lot of testing but appears to be working.

To test just checkout the branch and run as usual.

To re-build js/main-bundle.js from the modules run npm run build from the root directory.

To unpack the modules from the old minified code again

  1. Extract the huge array of modules embedded inside of js/main-unminified.js and put it in scripts/_old_main_packed_modules.js note: If you look carefully this whole ~150K line array is an argument to a function, so I can't think of a clean way to grab it from the script without more sophisticated (and error pone) parsing. Alternatively, if this branch is going to live for more than a week or so we could just adjust js/main-unminified.js to pop that array out into a field in the file and then I could safely get at it from the script. Since this is a one-time thing though I think it is just as easy to just manually extract it.
  2. From scripts, run node unpack_modules.js (it unpacks from scripts/_old_main_packed_modules.js)
  3. In the generated scripts/unpacked_modules/main.js there is one require('../server/utility.js') that needs converted to require('./server/utility.js')
  4. cp -r scripts/unpacked_modules/* js/
  5. Then re-build js/main-bundle.js by running npm run build from the root directory

This is a one-time thing so we shouldn't need the script or to re-run this unless we need it for some merges before this gets merged.

  • We can test this as is for now, but before merging we need to regenerate the modules using the script (as described above) or manually pull in commits after this branch was pulled from master like this one as due to the abandonment of in main-unminified.js in this branch git won't be able to auto merge.

activescott included the following code: https://github.com/forkdelta/forkdelta.github.io/pull/131/commits

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions