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

JS-to-TS migration #536

Merged
merged 174 commits into from Aug 5, 2019
Merged

JS-to-TS migration #536

merged 174 commits into from Aug 5, 2019

Conversation

@MurakamiShinyu
Copy link
Member

MurakamiShinyu commented Aug 5, 2019

johanneswilm and others added 30 commits Aug 21, 2018
…nBoxSizingParam` etc.
… error

I'm not sure this fix (`target as ElementStyleMap`) makes sense but it's just to eliminate the error.
…boolean;` for compile time configuration using webpack.DefinePlugin.
change `namespace.exportSymbol(...);` to `export namespace X { ... }`
```
prettier --write "src/ts/**/*.ts"
```

(Beautify TypeScript source code #528)
(Related issue: Beautify TypeScript source code #528)
- add "import/order": "error" setting in .eslintrc.js
- change import path "./base" to "../adapt/base" etc. for consistent import order
…unction foo() {...}`

(Related issue: Beautify TypeScript source code #528)
Before this update, the import names and file names are:
```
import * as Exprs from "../adapt/expr";
import * as LayoutImpl from "../adapt/layout";
import * as ViewerImpl from "../adapt/viewer";
import * as Columns from "../vivliostyle/column";
import * as Footnotes from "../vivliostyle/footnote";
import * as LayoutRetryers from "../vivliostyle/layoutretryer";
import * as Matchers from "../vivliostyle/matcher";
import * as MathUtil from "../vivliostyle/math";
import * as Pages from "../vivliostyle/page";
import * as RepetitiveElementImpl from "../vivliostyle/repetitiveelements";
```

After this update:
```
import * as Exprs from "../adapt/exprs";
import * as LayoutImpl from "../adapt/layoutimpl";
import * as AdaptViewer from "../adapt/adaptviewer";
import * as Columns from "../vivliostyle/columns";
import * as Footnotes from "../vivliostyle/footnotes";
import * as LayoutRetryers from "../vivliostyle/layoutretryers";
import * as Matchers from "../vivliostyle/matchers";
import * as MathUtil from "../vivliostyle/mathutil";
import * as Pages from "../vivliostyle/pages";
import * as RepetitiveElementImpl from "../vivliostyle/repetitiveelementimpl";
```

All file names are now same as the import names changed to lowercase.
(The import names were determined at vivliostyle/vivliostyle.js@bc72ed4 )

This update also renames "adapt/viewer" to "adapt/adaptviewer" (import * as AdaptViewer) to distinguish clearly with "vivliostyle/viewer".
The module "adapt/viewer" was originally the main module of the EPUB Adaptive Layout viewer. Now I decided to prefix "Adapt" to respect the original work.
…e.ts"

The "viewerapp" module has been not used since the [Vivliostyle-UI](https://github.com/vivliostyle/vivliostyle-ui/) was created as a separate component.
WIP: Update README and dev document for TypeScript source #533
- make consistent name between namespace (for interface defined in types.ts) and its correnpoiding implementation module file and import names.
  - e.g., namespace `Vtree` in types.ts, and implementation module file name `vtree.ts` and its import name is `Vtree` or `VtreeImpl`
- don't use "impl" suffix in source file name
  - e.g., × `layoutimpl.ts` → `layout.ts`
- use "Impl" suffix in import name only when need import same name namespace. e.g.:
    ```ts
    import * as VtreeImpl from "./vtree";
    import { Vtree } from "../vivliostyle/types";
    ```
    and when `import { Vtree } from ...` is not necessary:
    ```ts
    import * as Vtree from "./vtree";
    ```
Change
        cont.schedule();
to
        cont.schedule(true);
for fix error: An argument for 'result' was not provided.

NOTE: seems this boolean result value is not important and changing `undefined` to `true` will have no effect (need check)
Change
            result.marginoutside = 0;
to
            result.marginOutside = 0;

`marginoutside` was misspeling
- use "sort-imports" default setting.
- not use "import/order"

Now `import * as` lines are sorted alphabetically without grouping by source directory.
This is eslint "sort-imports" default setting and it is less problematic because in the current
source structure grouping by directory 'adapt' or 'vivliostyle' is not semantically important.
('adapt' directory contains modules originally from the adaptive-layout project and
'vivliostyle' directory contains modules created for vivliostyle.)
WIP: Update README and dev document for TypeScript source #533
Done #535
Update README and dev document for TypeScript source #533
@MurakamiShinyu MurakamiShinyu requested a review from spring-raining Aug 5, 2019
@MurakamiShinyu MurakamiShinyu merged commit 9aa6176 into master Aug 5, 2019
3 checks passed
3 checks passed
clahub All contributors have signed the Contributor License Agreement.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@MurakamiShinyu

This comment has been minimized.

Copy link
Member Author

MurakamiShinyu commented Aug 5, 2019

A bug found after the merge and fixed:

Copy link
Member

spring-raining left a comment

🎉

@MurakamiShinyu MurakamiShinyu added this to the JS-to-TS migration milestone Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.