Skip to content

Commit

Permalink
feat: migrate ionic start to Standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
dtarnawsky committed Nov 26, 2024
1 parent b2f8dfa commit 466bad0
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 50 deletions.
37 changes: 7 additions & 30 deletions ionic-start/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
import { Component, OnInit } from '@angular/core';
import {
provideVSCodeDesignSystem,
vsCodeButton,
vsCodeCheckbox,
vsCodeLink,
vsCodePanelView,
vsCodeProgressRing,
vsCodeTag,
vsCodeRadio,
vsCodeRadioGroup,
vsCodeTextField,
vsCodeDivider,
} from '@vscode/webview-ui-toolkit';
import { Component, CUSTOM_ELEMENTS_SCHEMA, OnInit } from '@angular/core';

import { MessageType, sendMessage } from './utilities/messages';
import { Template } from './utilities/template';
import { getValue } from './utilities/dom';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';

interface Framework {
name: string;
Expand All @@ -29,26 +19,13 @@ interface Target {
appearance: string;
}

// In order to use the Webview UI Toolkit web components they
// must be registered with the browser (i.e. webview) using the
// syntax below.
provideVSCodeDesignSystem().register(
vsCodeButton(),
vsCodeTextField(),
vsCodePanelView(),
vsCodeLink(),
vsCodeTag(),
vsCodeCheckbox(),
vsCodeDivider(),
vsCodeRadio(),
vsCodeRadioGroup(),
vsCodeProgressRing(),
);

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
standalone: true,
imports: [BrowserModule, FormsModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppComponent implements OnInit {
private templates: Template[] = [];
Expand Down
13 changes: 0 additions & 13 deletions ionic-start/src/app/app.module.ts

This file was deleted.

38 changes: 32 additions & 6 deletions ionic-start/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,39 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';
import {
provideVSCodeDesignSystem,
vsCodeButton,
vsCodeCheckbox,
vsCodeDivider,
vsCodeLink,
vsCodePanelView,
vsCodeProgressRing,
vsCodeRadio,
vsCodeRadioGroup,
vsCodeTag,
vsCodeTextField,
} from '@vscode/webview-ui-toolkit';

if (environment.production) {
enableProdMode();
}

platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch((err) => console.error(err));
// In order to use the Webview UI Toolkit web components they
// must be registered with the browser (i.e. webview) using the
// syntax below.
provideVSCodeDesignSystem().register(
vsCodeButton(),
vsCodeTextField(),
vsCodePanelView(),
vsCodeLink(),
vsCodeTag(),
vsCodeCheckbox(),
vsCodeDivider(),
vsCodeRadio(),
vsCodeRadioGroup(),
vsCodeProgressRing(),
);

bootstrapApplication(AppComponent).catch((err) => console.error(err));
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ionic",
"displayName": "Ionic",
"description": "Official extension for Ionic and Capacitor development",
"version": "1.98.0",
"version": "1.99.0",
"icon": "media/ionic.png",
"publisher": "Ionic",
"keywords": [
Expand Down

0 comments on commit 466bad0

Please sign in to comment.