Skip to content

Migrating from v11.x to v12.x

leo zhang edited this page Feb 27, 2019 · 3 revisions

We've changed the look of every component

Every component follows a more flat and simple look, it might require some refactoring of your existing custom CSS to make sure everything fits.

We've changed the basic layout code

The new layout code looks like this:

<!DOCTYPE html>
<html>
	<head>
		<title>My App</title>
		<meta name="viewport" content="width=device-width"/>
		<meta name="ts-app-title" content="My App"/>
		<link rel="ts-app-icon" href="my-icon.svg"/>
	</head>
	<body>
		<div data-ts="App">
			<div data-ts="Main">
				<div data-ts="Content">
					<div data-ts="Panel">
						<em>Start building your app here!</em>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>

compared to the old one:

<!DOCTYPE html>
<html>
	<head>
		<title>Layout</title>
		<meta name="viewport" content="width=device-width"/>
	</head>
	<body>
		<header data-ts="TopBar"></header>
		<main data-ts="Main">
			<div data-ts="MainContent">
				<h1>Main content</h1>
			</div>
		</main>
	</body>
</html>

Layout docs

We've removed all the old color mappings

We've introduced new colors, and instead of @ts-black, now you need to reference them as @ts-color-black.

They've also changed a lot, so it's worth the time to go through your code and make sure that all the colors line up with your expectations.

Colors docs

The Header is replacing the TopBar

The new Header component is baked into <div data-ts="App"> and can't be inserted via HTML anymore, only modified using attributes for the App component or ts.ui.Header.title(title).icon(iconUrl).color(colorName).

Header docs

Multiple levels of page-level tabs aren't supported

Instead of having tabs both in the TopBar/Header and an attached page-level TabBar, now you have to specify your tabs in the Header or specify multiples of Mains components to automatically generate them.

Mains docs

As a workaround for having multiple levels of page-level tabs, you can wrap your content inside a Board, and add tabs to it, effectively enabling a second level of tabs.

Boards docs

How to use v12 in v4

  1. import '@tradeshift/tradeshift-ui-v12' from src/v4apps/ui/12/nodemodules
  2. Add "manualLayout": true, in the manifest.json.
  3. Add data-ts="Main", data-ts="Content",data-ts="Panel" as new layout in your main page.
  4. Change the Topbar to Header and put an icon in the Header.
  5. If you have panel apps which use tradeshift-ui-v11, You have to use ts.io to isolate the panel app
  6. Sit down with designer and fix style to fit the new look of your app.