Releases: Yummygum/react-flagpack
V2.0.6
Fixed: Install Script Compatibility with pnpm
We've fixed a bug that caused the flags directory to be incorrectly copied into node_modules when using pnpm. The install script now correctly places the flags in your project's public/flags (or static/flags for Gatsby) directory, ensuring compatibility across npm, yarn, and pnpm.
Action Required:
- Update to version 2.0.6 to apply this fix.
This release has no breaking changes and ensures that react-flagpack works consistently. We recommend everyone upgrade to this release.
V2.0.5
Adds missing CLI depedency
v2.0.3
This version includes a minor fix regarding the install script.
It also marks some dependencies as dependencies so that the post-install script runs properly.
Full Changelog: v2.0.2...v2.0.3
v2.0.2
Duplicate of V2.0.0 with package-lock changes (this is the version published to npm)
What's new
This version reworks how React-flagpack works to work with public assets instead of inject flags through javascript.
This should ensure that React-flatpack works properly with any React library/framework as long as it supports rendering images.
This version has some breaking changes which require changes to your setup/cli, follow the migrating to 2.0.0 guide to get started.
Migrating to 2.0.0
To migrate to react-flagpack 2.0.0 you will need to make some minor changes to your code base. First you will need to add react-flagpack to your post-install hook see installation, then run yarn install (ensuring you are on at minimal react-flagpack 2.0.0).
After install you should see a flags folder in the public (or static) folder of your project.
Since react-flagpack styles are no longer injected in the Flag by default.
This change was made for two reasons:
- Server side support (the injecting relied on document)
- Not all users require the default styling so this caused unnecessary addition to bundle size
The new way of loading the CSS is by importing the default styles. You can do this in one of two ways.
// Component.tsx - In a component where flagpack is used
import 'react-flagpack/dist/style.css'
Or
/* Global.css - Importing it in the global css file */
@import 'react-flagpack/dist/style.css';
v2.0.0
What's new
This version reworks how React-flagpack works to work with public assets instead of inject flags through javascript.
This should ensure that React-flatpack works properly with any React library/framework as long as it supports rendering images.
This version has some breaking changes which require changes to your setup/cli, follow the migrating to 2.0.0 guide to get started.
Migrating to 2.0.0
To migrate to react-flagpack 2.0.0 you will need to make some minor changes to your code base. First you will need to add react-flagpack to your post-install hook see installation, then run yarn install (ensuring you are on at minimal react-flagpack 2.0.0).
After install you should see a flags folder in the public (or static) folder of your project.
Since react-flagpack styles are no longer injected in the Flag by default.
This change was made for two reasons:
- Server side support (the injecting relied on document)
- Not all users require the default styling so this caused unnecessary addition to bundle size
The new way of loading the CSS is by importing the default styles. You can do this in one of two ways.
// Component.tsx - In a component where flagpack is used
import 'react-flagpack/dist/style.css'
Or
/* Global.css - Importing it in the global css file */
@import 'react-flagpack/dist/style.css';
v1.2.0
Previous broken version
As was stated in #40, our current approach is broken. We've done some thinking on this in this flagpack-core discussion, but unfortunately our solution of using flagpack-core
as a dependancy to dynamically import SVG's has been proven rather troublesome.
New approach
I've suggested a new approach, that somewhat rewires the structure of our development implementations of the flagpack framework packages. Instead of using flagpack-core
as a dependancy, I've chosen to build react-flagpack
with the use of flagpack-core
. This means flagpack-core
now is a dev dependancy on required on build. There are some optimizations to be made here in the future, but for a proof of concept this should be a more robust solution.
This current approach still features dynamic imports and therefore accomplishes our goal regarding 'tree-shaking'. While the react-flagpack
may be larger in size, through the use of dynamic imports this should not increase the size of any application using react-flagpack
.
Changes
- Add
generate-flags
node script that builds the flags based onflagpack-core
- Add flag directory with flags for all sizes and values to
react-flagpack
- Moved
flagpack-core
to a dev dependancy as it's now only needed on build.
v1.1.0
First implementation of react-flagpack
based on the major change for flagpack-core
2.0.0
, which will make the package treeshakable. This will update react-flagpack
to version 1.1.0 🎉
Changes
react-flagpack
now uses a dynamic import. This results in only using the files needed within your project.- More information on the treeshaking implementation can be on the PR on flagpack-core and in the discussion.
v0.1.1
Fixes
- Updated flagpack-core package to v1.0.0 which fixes HM size
m
svg - Fix resolving url for newer React versions (
^17.0.0
)
v0.0.18
Updated flagpack-core to V0.0.34.