Skip to content
This repository has been archived by the owner on Jan 11, 2018. It is now read-only.

refactor: add latest bore and allow ts declaration generation #157

Closed
wants to merge 7 commits into from

Conversation

Hotell
Copy link
Collaborator

@Hotell Hotell commented Feb 3, 2017

No description provided.


import { ColorType, cssClassForColorType, css } from '../_helpers';
import {
ColorType,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thinking - what about change order of imports to first helpers, then types? like:
import { cssClassForColorType, css, ColorType, IntrinsicCustomElement, IntrinsicBoreElement, ClickEvent } from '../_helpers'

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm thats too much nit picking IMHO. But I see your point. We are importing a lot of stuff from helpers but that's what is it for.

Important is to always order imports in order

  • 3rd party
  • local ( non package related ) - this should go away when we have proper build
  • package internal relative imports

Maybe we can extract this definitions to root /packages/definitions.ts

Also that _helpers folder is wrong, it should be separate package named core or base

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe next time 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cheers mate 🍺

});

it( `should render`, () => {
return mount( <Button /> ).wait(( element ) => {
Copy link
Collaborator

@elmariofredo elmariofredo Feb 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we use <bl-button> here? I know that it's stated here https://github.com/wc-catalogue/blaze-elements/blob/master/docs/styleguides/TESTING.md#example--button- but I did forgot why.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we use here?

use what?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ups sorry forgot back ticks around the tag

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 still waiting for an answear

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't remember either ¯_(ツ)_/¯

maybe few suggestions about your review attitude:

  • if you intend to stop merging things because some unrelated unanswered questions, that's very unfortunate for velocity and for everyone that's participating on this project
  • we can change it ofc in another PR which should refactor other tests that have the same pattern and update the docs accordingly

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then please fix it to <bl-button>

thanks

p.s. this tone of suggestion is really unfortunate, point of PR is answering questions. PR comments are not the right place for discussing attitudes and any PR unrelated topic. Please contact me directly if you want to discuss this further. Thanks

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you pls unblock merging of this PR. You are blocking rest of the team. thx

type ButtonProps = Props & EventProps;
type Props = {
export type ButtonProps = Props & Attrs & EventHandlers;
export type Attrs = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could probably have everything in Props as all props will have attribute:{source: true} as default right? Or is there any reason to explicitly state it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it depends on Component ofc.
Button "primary" api is via attributes, that is also what is tested in test. Also this "clearly" separates type definitions to common pattern.
Props - primary API, should be preferred over attributes whenever possible
Attrs - only if primary API is via attributes,
Events - event aliases which we emit, specifically for bore h
EventHandlers - event aliases which we emit, specifically for IntrinsicElement consumption within other Virtual Dom view renderers

Attrs and Events are specifically for bores h while intersection of all 3 is our intrinsic element API.

We can discuss it further ofc, this is just what I ended up with, after evaluation of all possible scenarios

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I got the idea but I'm not sure what does it mean

only if primary API is via attributes

in reality. How you decide that that particular property is primarily attribute? Also I though that we won't test attributes as that's functionality which is tested in skatejs and in future it will be by default with attribute:{source: true}.

Let's discuss this with rest directly wdyt @hopkins-tk @davidrus?

@@ -3,6 +3,7 @@
"version": "1.2.0",
"main": "dist/main.js",
"license": "MIT",
"typings": "definitions/index.d.ts",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is up to discussion, because current build is non existent till #153

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well template should reflect desired state for each package, also it doesn't have to do anything with our current build if definitions are not working it shouldn't be here as well.

Simply I want to have package.json to be auto generated to some degree so we can easily change tooling for all packages.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comment was about the path of typings within package.json

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as you know there is build process from very beggining but its building test files instead of production bundles to dist folder, not sure how this is related to #153 if it is related somehow then you should wait before #153 is closed and even then add it to the template as well

@@ -1,5 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as 👆

@Hotell Hotell force-pushed the mh/new-bore-and-ts-declaration branch from c202710 to 57f6eaf Compare February 6, 2017 21:51
@Hotell Hotell changed the title Mh/new bore and ts declaration refactor: add latest bore and allow ts declaration generation Feb 6, 2017
});

it( `should render`, () => {
return mount( <Button /> ).wait(( element ) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 still waiting for an answear

@Hotell Hotell force-pushed the mh/new-bore-and-ts-declaration branch from 57f6eaf to 4fa8a55 Compare February 7, 2017 09:46
@Hotell
Copy link
Collaborator Author

Hotell commented Feb 7, 2017

Closing in favor of #168

#167 should be addressed in separate PR

@Hotell Hotell closed this Feb 7, 2017
@Hotell Hotell deleted the mh/new-bore-and-ts-declaration branch February 7, 2017 11:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants