Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

feat: NativeScript bootstrap transformer #634

Merged
sis0k0 merged 4 commits into master from replace-bootstrap
Aug 17, 2018
Merged

feat: NativeScript bootstrap transformer #634

sis0k0 merged 4 commits into master from replace-bootstrap
Aug 17, 2018

Conversation

Copy link
Contributor

@vakrilov vakrilov commented Aug 15, 2018
edited
Loading

The bootstrap transformer will automatically replace the platform and bootstrap calls inside main.ts when building with AOT.
This will eliminate the need for main.aot.ts and app.module.ngfactory.d.ts files in templates.

This depends on angular/angular-cli#11786 going public

sis0k0 reacted with thumbs up emoji sis0k0 reacted with hooray emoji sis0k0 and EddyVerbruggen reacted with heart emoji
const webpack = require("webpack");
const nsWebpack = require("nativescript-dev-webpack");
const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target");
const { nsReplaceBootstrap } = require("nativescript-dev-webpack/plugins/ns-replace-bootstrap");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you reexport that from the index file?

const entryModule = aot ?
nsWebpack.getAotEntryModule(appFullPath) :
`${nsWebpack.getEntryModule(appFullPath)}.ts`;
const entryModule = `${nsWebpack.getEntryModule(appFullPath)}.ts`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the getAotEntryModule function from index.js as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a breaking change if we remove it completely.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. We discussed to introduce a Deprecated decorator in another PR.

const ngCompilerPlugin = new AngularCompilerPlugin({
hostReplacementPaths: nsWebpack.getResolver([platform, "tns"]),
platformTransformers: aot ? [nsReplaceBootstrap(() => ngCompilerPlugin)] : null,
mainPath: resolve(appPath, "main.ts"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, that's from a previous PR (mine ;d), but I think it should be mainPath: entryModule instead of hardcoded to main.ts.

tsconfig.json Outdated
"files": [
"plugins/PlatformFSPlugin.ts",
"plugins/WatchStateLoggerPlugin.ts",
"plugins/ns-replace-bootstrap.ts",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mm, that's not really a webpack plugin. Can we move it to a transformers folder or something like that.

@vakrilov vakrilov changed the title (削除) [Do not merge] feat: NativeScript bootstrap transformer (削除ここまで) (追記) feat: NativeScript bootstrap transformer (追記ここまで) Aug 17, 2018
vakrilov and others added 4 commits August 17, 2018 14:22
The bootstrap transformer will automatically replace the platform and bootstrap calls inside `main.ts` when building with AOT.
This will eliminate the need for `main.aot.ts` and `app.module.ngfactory.d.ts` files in templates.
This won't work for projects that don't have dependency for
`@ngtools/webpack`.
@sis0k0 sis0k0 merged commit c016418 into master Aug 17, 2018
@sis0k0 sis0k0 deleted the replace-bootstrap branch August 17, 2018 14:01
sis0k0 added a commit that referenced this pull request Aug 28, 2018
It was removed (probably accidentally) in #634.
sis0k0 added a commit that referenced this pull request Aug 31, 2018
It was removed (probably accidentally) in #634.
sis0k0 added a commit that referenced this pull request Sep 10, 2018
<a name="0.16.0"></a>
# [0.16.0](0.15.1...0.16.0) (2018年09月10日)
 ### Features
 * NativeScript bootstrap transformer ([#634](#634)) ([c016418](c016418))
manoldonev pushed a commit to NativeScript/nativescript-app-templates that referenced this pull request Jan 9, 2019
They won't be needed with {N}-dev-webpack 0.16.0, because of this change
- NativeScript/nativescript-dev-webpack#634.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Reviewers
1 more reviewer

@sis0k0 sis0k0 sis0k0 approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /