Skip to content
This repository has been archived by the owner on Dec 6, 2021. It is now read-only.

Releases: egoist/poi

[email protected]

03 Jul 09:11
Compare
Choose a tag to compare

12.2.0 (2019-07-03)

Features

  • create-poi-app: add update notifier in pwa (#580) (5b4bbaf)

v12.6.1

04 Apr 09:52
Compare
Choose a tag to compare

v12.6.0

04 Apr 09:53
Compare
Choose a tag to compare

v12.4.6

22 Jan 16:22
Compare
Choose a tag to compare

Fixes

Validate config and set default values for config before applying plugins, fixes #530.

This release (12.4.6) also affects some plugins, you need to:

  • update @poi/plugin-vue-static to 12.0.6
  • update @poi/plugin-puppet to 0.1.4
  • update @poi/plugin-karma to 13.0.2

v12.4.2

09 Jan 10:24
Compare
Choose a tag to compare

Features

  • create-poi-app: add pnp feature

Fixes

  • poi: Support Yarn plug'n'play

v12.4.0

09 Jan 08:13
Compare
Choose a tag to compare

Features

  • Now a command called test or starts with test: will automatically run in test mode, therefore the @poi/plugin-karma now uses the command poi test:unit instead of poi karma --test.
  • A new hook to run before command: api.hook('beforeRun', () => Promise<void> | void)
  • Display memory usage under --serve

Fixes

  • Respect process.env.HOST and process.env.PORT
  • Dev client ES5 compatibility
  • A bug with output.publicUrl: './' under --serve

v12.2.0

18 Dec 16:12
Compare
Choose a tag to compare

🔥🔥 New Features 🔥🔥

No plugin needed for ReasonML

@poi/plugin-reason is deprecated since now you can just install @poi/bs-loader and your ReasonML app is good to build!

Convert named imports to use custom webpack loaders experimental

This is a new feature in our default babel preset. It does following things:

// .svg

import logoUrl, { ReactComponent as Logo } from './logo.svg'
// 👇👇👇
import logoUrl from './logo.svg'
import Logo from '!svgr/webpack!./logo.svg'

render(<Logo />, document.getElementById('app'))
// .md

import { ReactComponent } from './post.md'
// 👇👇👇
import ReactComponent from '!a-long-loader-chain!./post.md'

If you get an error that says some loader is missing, you need to install it.

Basically when you import ReactComponent from a .svg file or .md file, we use a babel plugin to add corresponding webpack loaders in front of the source path.

By default we support following named imports:

  • .svg: Supports ReactComponent import, of course the default import still works, it returns the path to the SVG file.
  • .md: Supports ReactComponent import.

Check out this to see the default config for this feature.

You can also extend this feature:

// poi.config.js
module.exports = {
  babel: {
    namedImports: {
      md: {
        default: '!file-loader![path]',
        html: '!markdown-loader![path]'
      }
    }
  }
}

Then in your JS file you can import default and html from a markdown file:

import filepath, { html } from './foo.md'

// The path to markdown file
console.log(filepath)
// HTML string
console.log(html)

v12.1.0

13 Dec 16:12
Compare
Choose a tag to compare

New feature

JavaScript files ending with .eval.{js,jsx,ts,tsx} will be evaluated at compile time (i.e. pre-evaluated by Node.js rather than your browser):

users.eval.js:

import fetch from 'node-fetch'

export default async function() {
  const users = await fetch('https://api.github.com/users').then(res => res.json())
  return { users }
}

index.js:

import { users } from './users.eval'

console.log(users)
// [{ login: 'mojombo' ...}]

Notably:

  • The file to eval must have a default export (export default or module.exports or module.exports.default) which is a function returning an object which can be serialized by JSON.stringify. (Or a Promise which resolves to such object.)
  • Tree shaking work well with the data imported from the evaluated file since it is treated as JSON module by webpack.
  • You can use this.addDependency(filepath) to make webpack watch specific files for changes. this is basically webpack's LoaderContext.

How to turn off this feature:

// poi.config.js
module.exports = {
  chainWebpack(config) {
    config.module.rules.delete('eval')
  }
}

v12.0.0

08 Dec 09:18
Compare
Choose a tag to compare

v12.0.0-beta.9

07 Dec 17:08
Compare
Choose a tag to compare
v12.0.0-beta.9 Pre-release
Pre-release

😎 New Features

Now it's easier to write plugin names:

// poi.config.js
module.exports = {
  plugins: [
    {
      // equivalent to `poi-plugin-typescript`
      resolve: 'typescript'
    },
    {
      // equivalent to `@org/poi-plugin-typescript`
      resolve: '@org/typescript'
    },
    {
      // equivalent to `@poi/plugin-typescript`
      resolve: '@poi/typescript'
    }
  ]
}

You can also use CLI flag to add plugins: --plugin <name> or --plugins <name>. If the plugins added from CLI flags are already added from config file, they will be ignored.