Skip to content

Sencha Cmd is not importing this package's component-specific rules or vars into application #1

@johnyanarella

Description

@johnyanarella

@dongryphon

You might remember me from the conversation you, Isaac Johnston and I had regarding Deft JS and Sencha Cmd at SenchaCon this year. We're continuing to refine our integration with Sencha Cmd on the Deft JS project as it continues to evolve (thanks for jumping in on the issue comments there!). I'm also trying to understand how I might use Sencha Cmd to distribute various UI components I've built for Sencha Touch and Ext JS. My hope is that these open-source components will be useful to others in the Sencha developer community and serve as a model others can follow for sharing components of their own.

Ext.ux.plugin.ScrollToTop is a plugin for the Sencha Touch Ext.List component that adds a floating button that animates into view once the user scrolls past a configurable threshold. Tapping this button animates the button back out of view, and scrolls the list back to the top (with a configurable animation duration). This is modeled after a feature of Facebook's native application for iOS. This component will be open-source under the MIT license.

I am attempting to create a signed redistributable Sencha Cmd package that can easily be required into third party developer's Sencha Touch applications. (I also intend to add the necessary metadata to make the package compatible with Sencha Architect 3.0, but I haven't gone down that road yet.)

This repository contains a workspace with the component defined within a package and an example application that uses that package.

The "ext-ux-plugin-scrolltotop" package includes the Ext.ux.plugin.ScrollToTop component:

packages/ext-ux-plugin-scrolltotop/src/ux/plugin/ScrollToTop

and supporting SASS rules and vars:

packages/ext-ux-plugin-scrolltotop/sass/var/ux/plugin/ScrollToTop
packages/ext-ux-plugin-scrolltotop/sass/src/ux/plugin/ScrollToTop

I've gone to great lengths to make the appearance highly customizable via these SASS vars.

package.sass.namespace is still set to the default Ext value, and I've mirrored the package structure between the JavaScript component source and SASS files. My understanding is that by segmenting these files in this manner, Sencha Cmd will only pull in the rules and vars that correspond to the components that are actually referenced by the application (in the hypothetical scenario there were more than just one component in this package).

To successfully build the package with Sencha Cmd (v3.1.2.342) I had to modify the package's sencha.cfg to add the skip.slice and skip.style flags. Otherwise, the resulting build failed (with the slice step enabled) or resembled a theme (with the style step enabled). I mention this since in case it's related to the issue at hand.

So here's the problem:

When I require this package in to the Example application, when I build the application, the rules and vars are not included.

Further, I'm also unclear as to when the default vars and rules would be loaded relative to the application's app.scss declarations. I assumed they would be automatically imported after the app.scss content. If a developer wanted to customize the vars would they need to explicitly @import the vars and rules from the package directory?

What am I missing here? :)

Thanks for any guidance you can provide!

On an unrelated note: as I've gotten further into this, I've been considering moving away from the "Ext.ux" namespace. Is there any guidance in the works from Sencha on naming of packages and class packages in this brave new Sencha Cmd world?

-John

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions