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

ES2015+ refactoring and project restructuring #69

Merged
merged 19 commits into from
Mar 15, 2018
Merged

Conversation

jccr
Copy link
Member

@jccr jccr commented Jan 18, 2018

Goal: Modernization

  • Remove Readium build tool scripts - Will be migrated over to readium-shared-js
  • Remove RequireJS as a bundler and its config files
  • Add Rollup.js as a bundler - It's great for producing libraries!
  • Make PEG.js generate output in CommonJS module format
  • Remove Yarn specifics - It's better to just use one package manager
  • Remove package.cson - The new package.json is simplified so it makes less sense to keep it
  • Add ESLint as a linter - Adopting the popular Airbnb style
  • Use Babel as an ES5 transpiler
  • Refactor code to take advantage of new ES2015 syntax, features, and imports/exports
  • Reformatted code using prettier --write --print-width 100 --single-quote --trailing-comma all --arrow-parens always [file], then used WebStorm to further customize the reformatting. For that I added the .idea files so it's reproducible and for convenience.
  • Remove dependency on Underscore.js - Replaced with a single lodash function and native functions instead.

This pull request is a Work In Progress

Related issue(s) and/or pull request(s)

readium/readium-js-viewer#373

Testing

Test suite mostly succeeds except with two cases due to a function reference issue with jasmine.spyOn

What needs to be done before merging

  • Fix two tests in the specs
  • Verify browser support, check if anything need to be polyfilled

What needs to be done after merging

  • Publish as an npm package
  • Reintegrate the usage in readium-shared-js and other projects

Juan Corona added 18 commits March 15, 2018 13:52
…d bundle output.

The created bundle is ready, with zero configuration, to be a dependency through NPM
* Removed Readium build tool scripts - Will be migrated over to readium-shared-js
* Removed RequireJS as a bundler and its config files
* Added Rollup.js as a bundler - It's great for producing libraries!
* PEG.js changed to generate in CommonJS module format
* Yarn specifics dropped - It's better to just use one package manager
* Removal of package.cson - The new package.json is simplified so it makes less sense to keep it
* Added ESLint as a linter - Adopting the popular Airbnb style
* Prepare codebase for ES2015+ refactoring
TODO: There's a bunch of "internal" public/exported/accessible functions that are not part of the original public API that need to be encapsulated again.
The tests need to get at them still, and I really like the simplicity with `export * from 'module'`. I don't want to have to register forwarding functions in the index like before.
There's no docs or compatible doc comments around it seems...
@jccr jccr merged commit bc243d8 into develop Mar 15, 2018
@jccr jccr deleted the feature/es-refactor branch May 3, 2018 17:01
jccr added a commit to evidentpoint/readium-cfi-js that referenced this pull request Aug 9, 2019
ES2015+ refactoring and project restructuring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant