Quantcast
Channel: Ember.JS - Latest topics
Viewing all 4838 articles
Browse latest View live

Upgrade from 2018 to Latest (3.15?)

$
0
0

@nico wrote:

Hi,

Been out of the Ember world a while and project I’ve done not the greatest (learned on the go) Did not touch it for a year, would like to try upgrade to the latest version of Ember before carrying on. (client requested some work)

Been thinking about just replacing the package.json with a copy of a new ember project (3.15.2) and then npm install the various dependencies I have (though worried some might not be around anymore?)

Any thoughts / advise? My "old project"s package.json below

  "name": "project_name",
  "version": "0.0.0",
  "private": true,
  "description": "project_name  UI",
  "license": "MIT",
  "author": "project_company",
  "directories": {
    "doc": "doc",
    "test": "tests"
  },
  "repository": "",
  "scripts": {
    "build": "ember build",
    "lint:js": "eslint ./*.js app config lib server tests",
    "start": "ember serve",
    "test": "ember test"
  },
  "devDependencies": {
    "@html-next/vertical-collection": "^1.0.0-beta.9",
    "broccoli-asset-rev": "^2.4.5",
    "ember-ajax": "^3.0.0",
    "ember-cli": "~2.18.1",
    "ember-cli-app-version": "^3.0.0",
    "ember-cli-babel": "^6.6.0",
    "ember-cli-bootstrap-sassy": "^0.5.8",
    "ember-cli-clipboard": "^0.8.1",
    "ember-cli-dependency-checker": "^2.0.0",
    "ember-cli-eslint": "^4.2.1",
    "ember-cli-file-saver": "^1.1.0",
    "ember-cli-htmlbars": "^2.0.1",
    "ember-cli-htmlbars-inline-precompile": "^1.0.0",
    "ember-cli-inject-live-reload": "^1.4.1",
    "ember-cli-qunit": "^4.1.1",
    "ember-cli-sass": "^7.1.4",
    "ember-cli-shims": "^1.2.0",
    "ember-cli-sri": "^2.1.0",
    "ember-cli-uglify": "^2.0.0",
    "ember-context-menu": "^0.4.0",
    "ember-data": "~2.18.0",
    "ember-export-application-global": "^2.0.0",
    "ember-light-table": "^1.12.2",
    "ember-load-initializers": "^1.0.0",
    "ember-local-storage": "^1.4.1",
    "ember-lodash": "^4.18.0",
    "ember-power-select": "^2.0.0-beta.0",
    "ember-power-select-typeahead": "^0.6.1",
    "ember-resolver": "^4.0.0",
    "ember-responsive": "^2.0.5",
    "ember-source": "~2.18.0",
    "ember-truth-helpers": "^2.0.0",
    "ember-web-api": "^1.0.1",
    "emberx-file-input": "^1.2.1",
    "eslint-plugin-ember": "^5.0.0",
    "file-saver": "^1.3.3",
    "loader.js": "^4.2.3"
  },
  "engines": {
    "node": "^4.5 || 6.* || >= 7.*"
  },
  "dependencies": {
    "bower": "^1.8.8"
  }
}

Posts: 1

Participants: 1

Read full topic


Cannot generate URL with dynamic segments using urlFor method

$
0
0

@nagarajan wrote:

Hello, people

Point me what’s wrong with my code,

I can able to generate URL using urlFor() when I’m in the route “/1/1/orders”. but I’m unable to generate a URL in the application route.

Kindly advise me.

here is the reference ember-twiddle

Posts: 1

Participants: 1

Read full topic

A little unsure if Info in Ember Inspector

$
0
0

@Andrew_Paterson wrote:

I’ve just upgraded my Ember app to 3.12.0 using ember-cli-upgrade and everything worked fine. The package.json file shows the ember-cli version as ~3.12.0 and package-lock.json reflects 3.12.0.

If I run ember --version the result is ember-cli: 3.12.1.

However, Ember Inspector reflects the Ember version as 3.16.0. Why does this discrepancy exist and what does it mean exactly?

image

Posts: 3

Participants: 2

Read full topic

Typescript: multiple inheritance?

$
0
0

@Hummingbird wrote:

I have come across a scenario migrating to typescript and octane, where I am having difficulties figuring out the right way in javascript. Pretty much what I need is multiple inheritance as shown below:

project -- private project-------
               \public project    \
                                   \
song -- private song -------- Shareable           
          \_ public song 

So, essentially, I have “abstract” classes (project, song) which exist in two variations: public and private. For instance project would define ED properties and methods that are the same for private and public projects. Then the private and public project classes inherit from project and define additional properties. This all worked fine so far, but now I need to add a second parent class Shareable. The Shareable base class would add methods and ED properties that are required to make a project or song shareable. This would be useful to implement a generic component that allows to share a private entity, by defining the input to be of type Shareable.

Long story short, my issue here is that js is not supporting multiple inheritance and I don’t see a way how I can make this work with single inheritance.

As for the backend, private project is a dedicated endpoint that requires authentication. public project is a dedicated endpoint that does not require authentication. And the result of sharing a private project is a public project.

Posts: 2

Participants: 2

Read full topic

How to mutate an array's value in “each” helper (Octane)

$
0
0

@Murali wrote:

I have an array of strings passed as an argument to a component, inside the component I am using “each” helper to render each string in a text input. I tried the following approach.

MainComponent.hbs
<Component @model={{model}}/>

//Eg: model.list = ["Jack", "Sparrow"];

Component.hbs
<div>
    {{#each this.args.model.list as |name|}}
    <div>           
         <PaperInput @value={{ name }} 
            @placeholder="Enter a Name"
            @onChange={{action (mut name)}}/>        
    </div>
    {{/each}}
</div>

I am running into the error “Uncaught (in promise) Error: Assertion Failed: You can only pass a path to mut”. Would really appreciate if anyone can let me know What’s going wrong here.

Posts: 1

Participants: 1

Read full topic

Ember with .Net Web Api

$
0
0

@nico wrote:

Old version of my app uses ember-web-api to have my app (2.18) work with a .net web api.

Trying to upgrade my app, starting with dependencies. Seems no work was done on the ember-web-api addon in years so wanted to find out if there’s alternatives now that will not take too many changes to implement.

Posts: 2

Participants: 1

Read full topic

The best way to promote Octane? Why, a killer app of course!

$
0
0

@larryh wrote:

And I have one.

Okay, I will wait until you stop laughing…

Done? Feel better? Good.

I’d like to start by by apologizing for the length of this post. But I think it’s important and worth reading. Besides, it’s Friday => we’re all gonna screw off at some point. So maybe you can just swap reading this for viewing a couple of cat videos.

I think the premise stated in the Subject line is true. As for actually having a killer app… well, I hope I do. (Just like everyone else, right?)

Octane’s technical improvements are impressive. (Thanks to everyone who contributed!) But, as @locks has said, I don’t think marketing talks for Ember are interesting. So have Ember be the vehicle through which you deliver something interesting. Which @melsumner echoed when she said, The way to get people to want to use Ember is by making fun projects and showing them.

And a little while back, @mehulkar said, Now, more than ever, Ember should be working on a better experience for simpler apps, which has been a big selling point for Octane.

I think all of us agree with that. And to expand on it, I think the the most effective thing we can do to get Ember back on the JS-framework radar is to blast through the misconceptions that are killing us: Ember is difficult to learn, and that it is used only by large corporations with large software development teams – which leads people to think, “Desktop Only.”

These misconceptions were probably best distilled into one strong statement, which Gabby Jameson, a student, relayed in her talk at EmberConf 2017: she said her advisor told her that, Using Ember to build a blog is like using a rocket ship to cross the street.

Ouch.

This is what we’re up against.

So what if we had an Octane app that we could point to in talks and blogs? Like @chriskrycho said awhile back, It’d be fantastic if crates.io ended up being another high-quality Ember app that we could point to!

And what if this app was simple? And developed by just one person? And was getting hundreds of thousands (hopefully millions) of downloads per day? On mobile?!

Think about that, while I move onto the app itself…

I won’t go into detail about it here, but in general it is my attempt to get Big Money out of politics, specifically Congress. A quote from the book, So Damn Much Money: The Triumph of Lobbying and the Corrosion of the American Government that appears on the About Us page says this:

We have a public that is just absolutely repulsed by everything that is going on in Washington. Essentially, they can’t stand all of the lobbying, they can’t stand all of the special interests, and they don’t think the public interest is represented.

I wrote the word “millions” up above, which I’m sure caused you to laugh. But I think you have to agree that millions of people do feel that way.

The front end is all Ember, and has been fully Octanized. (Or is that Octanified?) Regardless, I think I got it all, but no doubt have missed some small things.

The back end is Rails 6, with some of the major supporting players being MySQL, Devise, delayed job, redis/resque, Twilio (text messages), SendInBlue (emails).

It works on both desktop and mobile, in large part due to the work of @miguelcobain and the rest of the contributors to ember-paper. (Thanks to all of you for a great job!) If you’re not familiar with that, it’s Ember’s implementation of Google’s Material Design spec.

As far as it being a killer app with hundreds of thousands (millions!) of downloads per day – I think this is a real possibility, given what I said above, and the fact that all of the Democratic Presidential candidates have made the argument that this is one of – if not the - most important issue facing this country today. Heck, even The Donald harps about draining the swamp, and all of his supporters definitely seem to be on board with that.

I know I’m biased, but I feel this app has a very real chance of catapulting into the Zeitgeist. And if it does, I honestly cannot think of a better vehicle to get Ember back into the thick of the JS-framework discussions.

Now people giving a talk or writing a blog can reference a well-known, simple, mobile app, which will cause people to say something like, Whoa, wait a minute. So StupidTuesday is an Ember app? I never would’ve guessed that. Maybe it’s time I took another look at Ember.

Related to this, I proudly display a Powered by Ember Octane logo in the footer – which means a LOT of people could see that on a daily basis. And that footer-presence is probably something that most “real companies” would not allow. (NOTE: I know the footer needs tweaking, but since I’m not sure about the final color scheme, I did not want to waste time on something that is sure to change.)

So now what?

For now, I would like people to weigh in on this – about anything: the site, the concept, the assumptions, whatever. We all know how dangerous it is to develop something like this in a vacuum – and that is what I have done.

And later, I would like some help in both the technical (which includes usability) development/improvements of the app itself, along with promoting it (I am definitely not a social-media maven).

If the site sold T-shirts I could just hear the cynicism at this point: No shit he’d like some help. Because if this thing takes off he’s gonna get rich.

But that’s not the case. This is my “open source” contribution in the sense that it has been a labor of love, where countless unpaid hours have been spent in an effort to help others, not get rich.

And thinking about it, that’s another thing that could help Ember: the fact that our kick-ass community got behind an effort that most would agree is probably the biggest threat to our democracy. And that’s important stuff.

So that’s pretty much it. I don’t have a detailed list of the help that I would need – that can be part of this discussion thread – but as a heads-up, I’m thinking, in order:

  • Beta Test Staging
  • User Interface (No doubt a LOT here, but low-hanging fruit certainly includes improving the color scheme)
  • Usability and Accessibility (I shamefully admit I did nothing for the latter)
  • Promotion (Not yet; in fact, registrations are disabled on Production until at least some banging on Staging has taken place)

And then the following, which will serve to improve mobile download times - with the last two being things I believe the Core folks have their sights on anyway. (Maybe the site could be a good, simple, real-world, test vehicle for them!)

  • Remove jQuery dependencies (need to find alternatives for some of my add-ons)
  • SSR
  • Code splitting
  • Tree shaking

Thanks for taking the time to read and (hopefully) think about this. Color me corny, but I think the words “synchronicity” and “serendipity” come into play here. (We all have to look up the meanings of those two words, right? I mean, we all don’t know them off the top of our head, right?)

At roughly the same time:

  • Octane lands
  • StupidTuesday is ready to be released
  • The big-money-in-politics issue is in the forefront of the candidates’ minds and speeches
  • Millions of people are seriously pissed-off about this situation

Thanks,

Larry

P.S. I guess some website links would be in order…

Some background: Originally there was just one site for both normal users and admins: StupidTuesday.org. It had a Rails back-end, and the front-end was jQuery/jQuery-UI/jQuery-Mobile.

Like most websites, I decided that a JS framework was the way to go for the front-end, especially since it looked like jQuery-UI and jQuery-Mobile were no longer being worked on.

I chose Ember, and re-wrote the entire front-end in it. At first I tried to keep it all in one app/codebase, but in the end decided it made more sense to split it into two parts. I kept the lion’s share of the back-end intact, and modified portions of it to work with a separate Ember app. (Which, in retrospect, was definitely the way to go.)

There was no need to re-code all of the admin functionality (which, like most apps, is substantial) in the Ember app, so the Ember Octane app is for normal users, and the original app is for admins. (It still retains its normal-user capabilities – I didn’t bother yanking them – but they are no longer used.)

The lesser-used admin portion is now specified by a bnc subdomain, while the user-facing side is simply stupidtuesday.org. Still needing staging subdomains for both kept the confusion constant high, as now there are 4 URLs for basically just one website. (aarrgghh!)

Staging contains fake data for everything, for just 4 states (no need for all 50).

Production contains all 535 members of Congress, with over 14,000 real SellOuts (the site’s coin of the realm). I wrote screen-scrapers to get this data, figuring that If you build it they will come. But not if it’s empty.

User -> Staging: https://staging.stupidtuesday.org/ <Ember>

  • Can log in with a username and password of guest, but would prefer folks go through the sign-up process, and then update their profiles and settings.

User -> Production: https://stupidtuesday.org/ <Ember>

  • You can view all of the real data for all of the real politicians without logging in

Admin -> Staging: https://bnc.staging.stupidtuesday.org/ <jQuery>

  • Can log in with a username and password of guest.

  • Will see most of the admin functionality. (There are 5 authorization levels: guest, member, reviewer, admin, stupid-admin. This log-in confers admin capabilities.)

Admin –> Production: https://bnc.stupidtuesday.org/ <jQuery>

  • Fuhgeddaboudit :wink:

Posts: 1

Participants: 1

Read full topic

Ember.js - The Ember Times - Issue No. 133


Dynamic nested route Url mapping

$
0
0

@Toretto wrote:

I have two separate routes parking and Car (not a nested route).

Parking route has dynamic segment like parking id /parking/21 and Car has car name and id /car/ford/12

Router.js:

Router.map( function() {
   this.route("parking", { path: "/parking/:parkingId"})
   this.route("car", { path: "/car/:carName/:carId" })
});

when transition from parking route to car route, i need a url like (/parking/21/ford/12)

Posts: 1

Participants: 1

Read full topic

How to use Glimmer components in addon

$
0
0

@ondrejsevcik wrote:

Hi, I’ve tried to convert one of our components in addon to a glimmer component. It seems to pickup the component, but not the template.

I’ve put a console.log into the constructor and that was called, but it simply doesn’t render a thing.

Any idea what am I doing wrong?

Thank you

ember-cli 3.15
ember-source 3.12

Posts: 3

Participants: 2

Read full topic

Cross filter? Faceted filter?

$
0
0

@hcientist wrote:

I’m not sure the right terminology, does anyone know of any addons or other ember projects that demo a faceted filtering interface? Like some collection on display with each member having several dimensions that can be filtered on via some widgetry?

Posts: 2

Participants: 2

Read full topic

Query params @tracked

I am getting the below error when I am running ./watch command on my Visual Studio Code Terminal

$
0
0

@abdul wrote:

Hi I am getting the following error when I run the ./watch command at the Visual Studio Terminal any help please - thanks in advance please.

gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\aaleem\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:210:5) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) gyp ERR! System Windows_NT 10.0.17134 gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\aaleem\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “rebuild” gyp ERR! cwd C:\GitSourceCodes\IMS\IMS.Ember\node_modules\ttf2woff2 gyp ERR! node -v v12.12.0 gyp ERR! node-gyp -v v5.0.5 gyp ERR! not ok

gyp : The term ‘gyp’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • gyp ERR! build error
  •   + CategoryInfo          : ObjectNotFound: (gyp:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    
    

gyp : The term ‘gyp’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • gyp ERR! not ok
  •   + CategoryInfo          : ObjectNotFound: (gyp:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    
    
    

C:\GitSrsCodes

gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\aaleem\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:210:5) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) gyp ERR! System Windows_NT 10.0.17134 gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\aaleem\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “rebuild” gyp ERR! cwd C:\GitSrsCodes\IMS\IMS.Ember\node_modules\ttf2woff2 gyp ERR! node -v v12.12.0 gyp ERR! node-gyp -v v5.0.5 gyp ERR! not ok

Posts: 1

Participants: 1

Read full topic

Warning for infinite revalidation bugs is quite aggressive

$
0
0

@francesconovy wrote:

With Octane, we got some nice and usually helpful errors warning about updating properties that could lead to infinite revalidation bugs, e.g.:

Assertion Failed: You attempted to update `isPending` on `AsyncResource`, 
but it had already been used previously in the same computation. 
 Attempting to update a value after using it in a computation can cause logical errors, 
infinite revalidation bugs, and performance issues, and is not supported.

Now generally this is great, but I’ve found places where this is - to me - quite hard to follow and reason about, and I wonder if it might be a bit overzealous in some cases.

For example, I’ve been playing around with building a minimal async resource (until https://github.com/emberjs/rfcs/pull/567 lands) implementation like this:

import { tracked } from '@glimmer/tracking';
import { restartableTask } from 'ember-concurrency-decorators';

export class AsyncResource {
  promise;
  @tracked isPending = false;
  @tracked value;

  get state() {
    return {
      isPending: this.isPending,
      value: this.value
    };
  }

  async updatePromise(promise) {
    if (promise === this.promise) {
      return;
    }

    this._runPromise.perform(promise);
  }

  @restartableTask
  *_runPromise(promise) {
    this.promise = promise;
    this.isPending = true;

    let value = yield promise;

    this.value = value;
    this.isPending = false;
  }
}

With an accompanying component:

import Component from '@glimmer/component';
import { AsyncResource } from 'fabscale-app/utils/async-resource';

/*
 * This component takes a `promise` argument and yields an object with a `value` and a `isPending` property.
 * Note that the `value` will only change once the passed in promise is resolved!
 * This means that the last value will be used until a new value is resolved - it will not f.e. switch to `null` in between or similar.
 */
export default class AwaitPromise extends Component {
  /*
   * Arguments:
   *  - promise
   */

  _asyncResource;

  constructor() {
    super(...arguments);

    this._asyncResource = new AsyncResource();
  }

  get promiseData() {
    this._asyncResource.updatePromise(this.args.promise);

    return this._asyncResource.state;
  }
}

So usage is like this:

<AwaitPromise @promise={{this.myPromise}} |promiseData|>
  {{log promiseData}}
</AwaitPromise>

Now to me, it looks like this should work, but it triggers the invalidation error. I don’t think (?) this is a bug per se, but basically wanted to ask if that is expected/desired behavior? Or if there are any other ideas on how to better realize such behavior? I ended up with a considerably more complex code where I keep track if the promise has ever resolved and a sprinkle of yield timeout(1) before setting this.isPending, which kind of works but feels rather over-complicated.

Posts: 1

Participants: 1

Read full topic

Question about the Native Decorator Support feature

$
0
0

@samselikoff wrote:

I’m working on the next video in EmberMap’s free What’s New in Ember series and it’s for RFC 440 Native Decorator Support, which was a feature that landed in 3.10.

I’m trying to understand what this means for day-to-day Ember developers.

It looks like the #408 Decorator support RFC preceded this one, but I’m still not quite sure if either of these meant any recommended changes to user-facing APIs.

I believe the 3.15 guides were the first to show decorators, starting with the actions example in the quickstart. The 3.14 Quickstart still shows the actions hash as the recommended way to define actions, and the classic usage of things like computed properties.

So – if anyone could help me sort through this I’d be very grateful! The point of the series is to distill what each new Ember feature means to working Ember devs, so I want to make sure the information is accurate.

From what I can gather, these RFCs were more about setting the stage for Ember’s usage of decorators in later versions (3.15), and ironing out the commitment to supporting decorators even before they moved to stage 3. If true, that means a team who upgraded to 3.10 shouldn’t be changing how they write actions or decorators just yet. Is that correct?

Posts: 4

Participants: 3

Read full topic


Updating query params and tracked properties

$
0
0

@Joshua_Jenkins wrote:

I’m trying to pass filter values to an input component and have the query params update in real time.

I don’t understand how to link the input changes to the query params. The input is initialized from the current params.

Do I need to use an input action to manually update the param each time?

I’m having trouble thinking through this any further. Help much appreciated.

url: https://xxxx.com?search=yellow&price=1000to5000&year=1995to (params can be search or a range of values seperated by ‘to’)

Controller:

class MinMaxValue {
  @tracked min;
  @tracked max;

  constructor(param) {
    const minMax = param.split('to');
    this.min = minMax[0];
    this.max = minMax.length === 2 ? minMax[1] : '';
  }

  get param() {
    const param = `${this.min}to${this.max}`
    return param === 'to' ? '' : param;
  }
}

// Holds the filters
class Filter {
  @tracked search;
  @tracked price;

  constructor(search, price, year) {
    this.search = search;
    this.price = new MinMaxValue(price);
  }
}

export default
class ListingController extends Controller {
  queryParams = ['search', 'price'];
  search = '';
  price = '';
  
  @tracked filter = new Filter(this.search, this.price);
}

Component:

<Input @value={{@filter.search}} />
<Input @value={{@filter.price.min}} />
<Input @value={{@filter.price.max}} />

Doing something like the following gets into an infinite loop:

  @computed('filter.price.param')
  get price() {
    return this.filter.price.param;
  }

A plain getter doesn’t update?

Posts: 1

Participants: 1

Read full topic

I want to use observer in Ember 3.15

$
0
0

@1115 wrote:

I want to use observer in Ember 3.15

Here is my source in Ember 3.14

import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
import { observer } from '@ember/object';


export default Controller.extend({
   session: service(),
    
   ooUserId : observer('session.user.id', function(){
     console.log("session.user.id changed!!");
   })
})

Here is my source in Ember 3.15

import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
import { action, observer } from '@ember/object';

export default class ApplicationController extends Controller {
	@service session;
}

How should I change?

Posts: 1

Participants: 1

Read full topic

Linter warning about object as default property

$
0
0

@bsylvain wrote:

My linter return the following warning: Only string, number, symbol, boolean, null, undefined, and function are allowed as default properties ember/avoid-leaking-state-in-ember-object

for this line in a model :

providerValues:{someprovider:'Some Provider',otherprovider:'Other Provider' }

That I use to complete this property : provider:DS.attr('string')

How should I set static values in a model to avoid this warning ?

Posts: 1

Participants: 1

Read full topic

If not unloadAll or unloadRecord, what can I do/use?

$
0
0

@melriffe wrote:

Sorry for the click-bait title but I’m not sure how else to frame my question/request.

First: I’m using: ember-cli: 2.18.2 calling a Rails JSONAPI-compliant backend. This project is generally a rewrite of the frontend. The backend process have not been altered but to comply with a JSONAPI Responses. Rewriting those processes is out of scope, completely.

Second: I’m struggling a bit and I was wondering if folks could lend a hand, or some guidance/advice. I think I’m struggling with Ember Data’s “stickiness” (my term).

We have a process that creates and destroys database records in the backend. These records are requested for display and processing. This is done by requesting this process be run via a user-initiated action (i.e. they click a button). After the user has processed this data, making adjustments, if you will, they can request this process be run again.

Like I mentioned: the backend process destroys the previously created records, creates new ones, and returns the new records.

I now have old models in the store that are getting counted when they shouldn’t.

I’ve tried using unloadAll('<type>') and unloadRecord() because I’m trying to get the old models out of the store. However, there is a fetch involved and for the old records they are indeed gone; a 404 is returned, rightfully.

If I’m on the wrong path, please let me know with some gentle redirection. What should/could I be doing instead?

Ideally, here’s what I would like to happen: Just before the process is requested I remove the old models from the store, request the process, and then load up the new models.

I can try to provide additional details if requested. Suffice it to say, I’m banging my head against the wall here.

Thank you for your time.

Posts: 1

Participants: 1

Read full topic

Ember.js - The Ember Times - Issue No. 134

Viewing all 4838 articles
Browse latest View live