-
Notifications
You must be signed in to change notification settings - Fork 3
Remove pancake #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
069a84d
Added new RFC proposal
dominikwilkowski 17e54cb
Merge branch 'main' into remove-pancake
dominikwilkowski 3bd3d4b
fixed up markdown
dominikwilkowski 0d6e32d
Merge branch 'main' into remove-pancake
dominikwilkowski fe05d19
finished RFC
dominikwilkowski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| --- | ||
| Status: `Proposal` # Please do not change this. | ||
| Implementer: # It will be changed upon merging and as it moves through the RFC stages | ||
| --- | ||
|
|
||
| # Remove pancake | ||
|
|
||
| ## The issue to be solved | ||
|
|
||
| Pancake has been built (by me) a while ago and solved a couple very specific problems outlined in [this article](https://medium.com/dailyjs/npm-and-the-front-end-950c79fc22ce). | ||
| Since 2018 the front end space has evolved significantly and shipping CSS files via npm isn't an issue anymore. | ||
| In-fact shipping CSS files that are automatically imported by the prod bundle located inside a `node_modules/` folder causes significant issues to loaders like webpack which now require the CSS loader to be specified and the specifically allow the `node_modules/` path. | ||
|
|
||
| ## A short description of the solution | ||
|
|
||
| We should remove pancake from the `postinstall` npm hook and deliver the CSS separately in the npm payload. | ||
| This means consumers can use the CSS file the way they like including via the `<link>` HTML tag. | ||
|
|
||
| ## Technical details | ||
|
|
||
| 1. Remove the `postinstall` hook from each packages `package.json` | ||
| 2. Remove the code that injects the imports automatically from [the helper](https://github.com/designsystemau/design-system-components/blob/master/scripts/helper.js#L432) | ||
| 3. Document how to use the components and the CSS together | ||
|
|
||
| The way you would have to use the components in react would then be: | ||
|
|
||
| ```js | ||
| import Button from '@gold.au/buttons'; | ||
|
|
||
| import '@gold.au/buttons/styles.css'; | ||
|
|
||
| function MyApp() { | ||
| return <Button>My button</Button>; | ||
| } | ||
| ``` | ||
|
|
||
| This will require the [webpack CSS loader](https://webpack.js.org/loaders/css-loader/) in webpack while Parcel requires no config. | ||
|
|
||
| The Sass files will then not be available anymore for integration as they currently feature lines like: | ||
|
|
||
| ```sass | ||
| @import '../../../core/src/sass/_module.scss'; | ||
| ``` | ||
|
|
||
| That path is only available within the monorepo. | ||
|
|
||
| ❗️ This means no more Sass exports. | ||
elisechant marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.