-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
JS-to-TS migration #536
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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.
…espace X { ... }`
change `namespace.exportSymbol(...);` to `export namespace X { ... }`
Before this update, types of parameters and return values are missing on overriding methods, and type-checking does not work. (Related issue: Beautify TypeScript source code #528)
``` 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 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
… type 'ChildNode'
- 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
Update README and dev document for TypeScript source #533
A bug found after the merge and fixed:
|
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.
🎉
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JS-to-TS migration: https://github.com/vivliostyle/vivliostyle.js/milestone/1
Related PR on Vivliostyle-UI: vivliostyle/vivliostyle-ui#68