Skip to content

Commit

Permalink
update to react version to 16.13.1 and ionic core with swiper version…
Browse files Browse the repository at this point in the history
… 6.3.5

react 16.8.6 Detached DOM node memory leak: facebook/react#18066
  • Loading branch information
match08 committed Nov 26, 2020
0 parents commit c23af07
Show file tree
Hide file tree
Showing 93 changed files with 18,321 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build.sh
*.tgz
dist
__mocks__
css
dist-transpiled
node_modules
.DS_Store
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
116 changes: 116 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# [4.10.0-rc3]

## Bug fixes

Pages should maintain their original previous page id [2afcb6](https://github.com/ionic-team/ionic/commit/2afcb6c80b167b95beb79641504d9237b498dbef), fixes [#19351](https://github.com/ionic-team/ionic/issues/19351)

Dismiss overlay component on unmount, [3c2694](https://github.com/ionic-team/ionic/commit/3c26946d47b37d42dfaa3294cfb6bf8f0ef11aa4), fixes [#19377](https://github.com/ionic-team/ionic/issues/19377)

Render first route even if url is same, fixes [#19392](https://github.com/ionic-team/ionic/issues/19392)

## Breaking Changes

### Events have been updated to use proper types from React

The types for events (such as `onClick`) were not typed correctly prior to RC3. Before, they were the normal browser events, but now they are the proper React Synthetic events. Therefore, you might have type errors that need to be remedied:

```typescript
function handleClick(e: MouseEvent) {
...
}
```

Will need to become:

```typescript
function handleClick(e: React.MouseEvent) {
...
}
```

Some Ionic components have the option to pass the event to them (like `IonPopover`). For these, you can access the `nativeEvent` property on the React synthetic event.

### Components with href attributes and the new routerLink prop
As of RC3, components that use the href prop (`IonButton`, `IonItem`, etc..), no longer run these links through the router. As a result, page transitions are no longer applied to these links. To maintain page transitions, use the new `routerLink` prop instead. The href prop should be used when you want to enforce a full browser transition on the page, or when you need to link to an external resource.

# [4.9.0-rc2]

## Features

Dependencies upgraded to work with Ionic Core 4.9

## Bug Fixes

IonPage should be root page for Ionic Pages - fixes [#19146](https://github.com/ionic-team/ionic/issues/19146)

## Breaking Changes

### IonPage should be the parent component of Ionic Pages

`IonPage` is a specialized component that is meant to be the parent container for an Ionic Page, which typically consists of `IonHeader` and `IonContent` components. Previous to RC3, the `@ionic/react-router` library would add this component itself, but this caused some confusion around how `IonPage` should be used and why it was even available. Devs would sometimes include `IonPage` themselves as the parent of their pages, but this could cause issues with page transitions.

To clear up this confusion, we decided to stop adding the `IonPage` component in the framework and offer guidance that devs should use `IonPage` as the base component in their Ionic Pages.

Apps migrating from a previous version to RC2 will need to make sure `IonPage` is used as the root component for every Ionic page. Ionic Pages typically have `IonHeader` and `IonContent` tags and are the components rendered by the routes. The starters used a React Fragment before, and this fragment needs to be changed to `IonPage`. Any other uses of `IonPage` should probably be removed.

Example:

An Ionic Page before RC2 most likely has a React fragment as its root:

``` jsx
<>
<IonHeader>/* header stuff */</IonHeader>
<IonContent>/* content stuff */</IonContent>
</>
```

In RC2 and greater, the fragment should be updated to an IonPage component:

``` jsx
<IonPage>
<IonHeader>/* header stuff */</IonHeader>
<IonContent>/* content stuff */</IonContent>
</IonPage>
```

### ViewManager

The `<ViewManager />` component is no longer needed and can be removed. The views inside of an `<IonRouterOutlet>` are now managed by an internal stack manager and don't need the explicit ViewManager anymore.

`ViewManager` is now a noop component and shows a warning message while in development. `ViewManager` will be removed in the final release of @ionic/react.

## Other Changes

### Tab Route Setup

Prior to RC2, tabs had to specify a tab name in their routes which helped with the page transitions. This was set up in the form of a regex named parameter like so:

`<Route path="/:tab(tab1)" component={Tab1} exact={true} />`

This is no longer a requirement. Routes setup this way will continue to work, but the complexity in the path can be removed and updated to:

`<Route path="/tab1" component={Tab1} exact={true} />`

# [4.8.0-rc1]

## Features

Dependencies upgraded to work with Ionic Core 4.8

## Bug Fixes

Attributes applied to Ionic Components now show up in the DOM and are visible in devtools

`IonBackButton` now preserves the query string parameters from the referring page: https://github.com/ionic-team/ionic/pull/19150/commits/2e2068ee5ea467636b4454e1106df1d8f05230d2

Supporting class attributes as well as className attributes for Ionic React components: https://github.com/ionic-team/ionic/pull/19150/commits/bef7bc8b1b190bf704fd6960711672bfd7aedfa6, closes [#19107](https://github.com/ionic-team/ionic/issues/19107)

Exporting the previously missing isPlatform method from core: https://github.com/ionic-team/ionic/pull/19150/commits/fc817471582785a00db77ee922a73ccfda42b870, closes [#19122] https://github.com/ionic-team/ionic/issues/19122

# [4.8.0-rc0]

Welcome to React RC!

### Breaking Changes

There is a new `ViewManager` component exported from @ionic/react-router. If you have an `IonRouterOutlet` component outside of a tabs component, you will need to wrap the `IonRouterOutlet` with the `ViewManager` to preserve the transitions and state management that the IonRouterOutlet provide on its own in the betas.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
## @ionic/react

These are React specific building blocks on top of [@ionic/core](https://www.npmjs.com/package/@ionic/core) components/services.

To get started, install the Ionic CLI by running `npm i -g ionic`. Then, start a new Ionic React Project by running `ionic start myapp --type=react`.

# Current Status of Components

Below is a list of components yet to be implemented:

| Component |
| ------------------ |
| `IonVirtualScroll` |

## Publishing a Native Application

You can now make use of all of the ionic components in your React application.
If you want to publish your app to the App Store or Google Play you will need to use the ionic cli to execute Capacitor commands to do so.

More information on this can be found here. https://ionicframework.com/docs/cli
If you want to learn more about Capacitor our dedicated site can be found here. https://capacitor.ionicframework.com/

The commands that you will need to execute are below in your project's root.

```sh
ionic init "My React App" --type=react
ionic integrations enable capacitor
```

Then run the following command to get started with either `ios` or `android` platforms.
```
ionic capacitor add <android|ios>
```

After build you build your app you will need to copy your capacitor resources into the build dir so execute the following command.
```
ionic capacitor copy
```

To open your application to build/emulate in Android Studio or Xcode run the `open` command.
```
ionic capacitor open <android|ios>
```


## Related

* [Ionic Documentation](https://ionicframework.com/docs/)
* [Ionic Forum](https://forum.ionicframework.com/)
* [Ionicons](http://ionicons.com/)
* [Capacitor](https://capacitor.ionicframework.com/)


## License

* [MIT](https://raw.githubusercontent.com/ionic-team/ionic/master/LICENSE)
7 changes: 7 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
window.matchMedia = window.matchMedia || function() {
return {
matches : false,
addListener : function() {},
removeListener: function() {}
};
};
88 changes: 88 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"name": "@ionic/react",
"version": "5.5.1",
"description": "React specific wrapper for @ionic/core",
"keywords": [
"ionic",
"framework",
"react",
"mobile",
"app",
"hybrid",
"webapp",
"cordova",
"progressive web app",
"pwa"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/ionic-team/ionic.git"
},
"scripts": {
"build": "npm run clean && npm run copy && npm run compile",
"clean": "rimraf dist && rimraf dist-transpiled && rimraf routing",
"compile": "npm run tsc && rollup -c",
"release": "np --any-branch --yolo --no-release-draft",
"lint": "tslint --project .",
"lint.fix": "tslint --project . --fix",
"tsc": "tsc -p .",
"copy": "node scripts/copy.js",
"test.spec": "jest --ci",
"test.treeshake": "node scripts/treeshaking.js dist/index.esm.js"
},
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "dist/types/index.d.ts",
"files": [
"dist/",
"css/"
],
"dependencies": {
"@ionic/core": "https://github.com/match08/ionic5-core/archive/v5.5.1.tar.gz",
"ionicons": "^5.1.2",
"tslib": "*"
},
"peerDependencies": {
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^8.1.0",
"@rollup/plugin-virtual": "^2.0.3",
"@testing-library/jest-dom": "^5.11.0",
"@testing-library/react": "^10.4.9",
"@types/jest": "^26.0.3",
"@types/node": "^14.0.14",
"@types/react": "16.14.0",
"@types/react-dom": "^16.9.0",
"fs-extra": "^9.0.1",
"jest": "^26.4.1",
"np": "^6.4.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"rimraf": "^3.0.2",
"rollup": "^2.26.4",
"rollup-plugin-sourcemaps": "^0.6.2",
"ts-jest": "^26.1.1",
"tslint": "^6.1.2",
"tslint-ionic-rules": "0.0.21",
"tslint-react": "^5.0.0",
"typescript": "^3.9.5"
},
"jest": {
"preset": "ts-jest",
"setupFilesAfterEnv": [
"<rootDir>/jest.setup.js"
],
"testPathIgnorePatterns": [
"node_modules",
"dist-transpiled",
"dist",
"test-app"
],
"modulePaths": [
"<rootDir>"
]
}
}
31 changes: 31 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import resolve from '@rollup/plugin-node-resolve';
import sourcemaps from 'rollup-plugin-sourcemaps';
// import json from '@rollup/plugin-json';

export default {
input: {
'index': 'dist-transpiled/index',
// 'routing/index': 'dist-transpiled/routing/index'
},
output: [
{
dir: 'dist/',
entryFileNames: "[name].esm.js",
chunkFileNames: "[name]-[hash].esm.js",
format: 'es',
sourcemap: true
},
{
dir: 'dist/',
format: 'commonjs',
preferConst: true,
sourcemap: true
}
],
external: (id) => !/^(\.|\/)/.test(id),
plugins: [
resolve(),
sourcemaps(),
// json()
]
};
16 changes: 16 additions & 0 deletions scripts/copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const fs = require('fs-extra');
const path = require('path');

function copyCSS() {
const src = path.join(__dirname, '..', '..', '..', 'core', 'css');
const dst = path.join(__dirname, '..', 'css');

fs.removeSync(dst);
fs.copySync(src, dst);
}

function main() {
copyCSS();
}

main();
Loading

0 comments on commit c23af07

Please sign in to comment.